[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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.