Thursday 06 April 2006 8:00:13 am
Hi Here's how to move eZ publish from the root to <i>mydir</i>
Apache rewrite settings: Before:
# eZ publish 3.7
<VirtualHost 127.0.0.7:*>
<Directory /home/hovik/public_html/ezp37 >
Options FollowSymLinks
AllowOverride None
</Directory>
<IfModule mod_php4.c>
php_admin_flag safe_mode Off
php_admin_value register_globals 0
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
php_value allow_call_time_pass_reference 0
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^soap\..*
RewriteRule .* /soap.php [L]
RewriteCond %{HTTP_HOST} ^webdav\..*
RewriteRule .* /webdav.php [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 ^/.* /index.php
</IfModule>
DocumentRoot /home/hovik/public_html/ezp37
ServerName ezp37
ServerAlias admin.ezp37
ServerAlias soap.ezp37
ServerAlias webdav.ezp37
ServerAlias intranet.ezp37
</VirtualHost>
After:
# eZ publish 3.7
<VirtualHost 127.0.0.7:*>
<Directory /home/hovik/public_html/ezp37 >
Options FollowSymLinks
AllowOverride None
</Directory>
<IfModule mod_php4.c>
php_admin_flag safe_mode Off
php_admin_value register_globals 0
php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0
php_value allow_call_time_pass_reference 0
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^soap\..*
RewriteRule .* /mydir/soap.php [L]
RewriteCond %{HTTP_HOST} ^webdav\..*
RewriteRule .* /mydir/webdav.php [L]
Rewriterule ^/mydir/var/storage/.* - [L]
Rewriterule ^/mydir/var/[^/]+/storage/.* - [L]
RewriteRule ^/mydir/var/cache/texttoimage/.* - [L]
RewriteRule ^/mydir/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/mydir/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
Rewriterule ^/mydir/share/icons/.* - [L]
Rewriterule ^/mydir/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?)/.* - [L]
Rewriterule ^/mydir/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
RewriteRule ^/mydir/.* /mydir/index.php
</IfModule>
DocumentRoot /home/hovik/public_html/ezp37
ServerName ezp37
ServerAlias admin.ezp37
ServerAlias soap.ezp37
ServerAlias webdav.ezp37
ServerAlias intranet.ezp37
</VirtualHost>
settings/override/site.ini.apppend.php needs this alteration:
[SiteSettings]
SiteURL=ezp37/mydir
This behavior was fixed in rev. 13713, so it should work with eZ publish 3.7.1 and newer releases.
Kåre Høvik
|