Forums / Install & configuration / [SOLVED] 3.10.0 ezurl()|nice url - how to do it?

[SOLVED] 3.10.0 ezurl()|nice url - how to do it?

Author Message

Bernd Winkelmann

Sunday 04 November 2007 9:41:23 am

i have reading that in virtualhost environment using host access method all urls made by ezurl() are made as "nice url"

http://ez.no/doc/ez_publish/technical_manual/3_10/reference/template_operators/urls/ezurl

i tested this and the result are url's like this www.my_site.com/index.php?/path/to/site

in a older tread was a statement that is necessary to set ForceVirtualHost=true in site.ini overwrite.

so i tried that, and after this change the urls are ok but i doesn't become access to my sites (403 forbidden).

what must i do to become the access to my sites in this case?
are where other settings?

that can i do - i want to have "nice url's" without index.php? and i doesn't want to change all templates using ezroot. (http://ez.no/ezpublish/documentation/customization/tips_tricks/creating_nice_urls)

a problem seems that i have in my url the question mark after index.php - and i doesn't understand why. somebody told me that is because i'm using php as cgi module?

thanks for helpful tips
bernd

Bernd Winkelmann

Tuesday 06 November 2007 2:52:57 am

I have solved the problem - following i will describing what i have done.

1.my environment:
- sheared hosting server (packages are a nice low budget recommendation for users in germany -> http://www.webhosting-franken.de)
- no access to serverconfig (httpd.conf) so the virtual host configuration must be done by using .htaccess
- but i have access to the php.ini - so i have done the php setting part of vh configuration in php.ini
- Apache 2.2
- 4.4.7-0.dotdeb.1 - (as fastcgi module)
- ezPublish 3.10.0 installed with host access mode
- ForceVirtualHost=true (site.ini overwrite) default is false

2. my .htaccess in ezPublish installation root

Options +FollowSymlinks 

DirectoryIndex index.php

RewriteEngine On
RewriteBase /

# to avoid double entries in searchengine indexes
RewriteCond %{HTTP_HOST} ^(my_domain\.de)$
RewriteRule ^(.*)$ http://www.my_domain.de/$1 [redirect=permanent,last]

# to use WebDAV
RewriteCond %{HTTP_HOST} ^(webdav\..*)$
RewriteRule ^(.*)$ webdav.php [L]

# to use SOAP
RewriteCond %{HTTP_HOST} ^(soap\..*)$
RewriteRule ^(.*)$ soap.php [L]

# swiching for this cases the frontcontoller access
RewriteRule ^robots\.txt$  - [L]
RewriteRule ^favicon\.ico$ - [L]
RewriteRule ^sitemap\.xml - [L]
Rewriterule ^var/storage/.*$ - [L]
Rewriterule ^var/[^/]+/storage/.*$ - [L]
RewriteRule ^var/cache/texttoimage/.*$ - [L]
RewriteRule ^var/[^/]+/cache/texttoimage/.*$ - [L]
Rewriterule ^design/[^/]+/(stylesheets|images|javascript)/.*$ - [L]
Rewriterule ^share/icons/.*$ - [L]
Rewriterule ^extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.*$ - [L]
Rewriterule ^packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.*$ - [L]
RewriteRule ^packages/styles/.+/thumbnail/.*$ - [L]
 # Uncomment the following lines when using popup style debug. 
 # RewriteRule ^/var/cache/debug\.html.* - [L] 
 # RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L] 

# for use of dynamicTreemenu
RewriteRule ^content/treemenu/.*$ index_treemenu.php [L]

# directing all other requests to the frontcontroller 
RewriteRule .* index.php

3. (changed) php.ini settings:

safe_mode Off
register_globals Off
php_value magic_quotes_gpc Off
php_value magic_quotes_runtime Off
php_value allow_call_time_pass_reference Off

now system runs in a identical virtual Host environment like it was described in manual
http://ez.no/doc/ez_publish/technical_manual/3_10/installation/virtual_host_setup

4. the problem

although the system now is producing nice-url's in this style:

www.my_site.com/path/to/site

(before "ForceVirtualHost=true" was www.my_site.com/index.php?/path/to/site - the question mark results when using php as cgi module)

i doesn't become access to my sites using this url's (serversite 403 forbidden)

it seems that for a little moment was dispayed the site title before comes the 403.

5. my solution

so i made this hack in my .htaccess before rewriting

<FilesMatch "([^.+])$">
order allow,deny
allow from all
</FilesMatch>

now are all sites are accessible - system is running fine

but i haven't not a spoor of understanding for the problem itself and for eventual other effects of this hack.

if somebody can give me tips for a other way of solution or a qualified opinion, i would be happy :-)

thanx
bernd

Nehal Rupani

Wednesday 24 September 2008 2:37:59 am

Hi Bernd,

I running my site under shared domain and got same problem like you have access to .htaccess and need to control virtual host with .htaccess file. i just wanted to know is it possible to set up virtual host using .htaccess file. and also could higlight file in which i need replace operator |ezurl to |ezroot.

Thanks,
Nehal Rupani

eZ debug

Timing: Jan 18 2025 04:55:52
Script start
Timing: Jan 18 2025 04:55:52
Module start 'content'
Timing: Jan 18 2025 04:55:52
Module end 'content'
Timing: Jan 18 2025 04:55:52
Script end

Main resources:

Total runtime0.1779 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.0000180.8047
Module start 'content' 0.00600.0053 769.804797.9766
Module end 'content' 0.01130.1665 867.7813527.1250
Script end 0.1778  1,394.9063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.9421200.0002
Check MTime0.00140.7972200.0001
Mysql Total
Database connection0.00050.298510.0005
Mysqli_queries0.130273.18421410.0009
Looping result0.00160.87721390.0000
Template Total0.166193.410.1661
Template load0.00080.455910.0008
Template processing0.165392.930510.1653
Override
Cache load0.00060.316510.0006
Sytem overhead
Fetch class attribute can translate value0.00100.534710.0010
XML
Image XML parsing0.00030.144010.0003
General
dbfile0.00452.5374200.0002
String conversion0.00000.004630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs