Sunday 21 December 2003 11:24:51 pm
Hi, I've finally managed to hide the index.php part of my urls without having to modify the httpd.conf file. So here's how I did it. (ezCrew or anyone who knows .htaccess config, please could you check this for potential security issues as I am not a .htaccess specialist)
Step 1: In my document root .htaccess file, I created a redirect to my ezp3 directory.
********************************************** Options ExecCGI FollowSymLinks Includes MultiViews
<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html))$">
order allow,deny
allow from all </FilesMatch>
RewriteEngine On
RewriteRule ^$ /<path-to-ezPublish>/ [R] RewriteRule ^/(.*)$ /<path-to-ezPublish>/$1
DirectoryIndex index.php ********************************************
Step 2: Added code to my ezPublish directory .htaccess file to remove the index.php part of the url.
*********************************************
<FilesMatch "(index\.php|\.(gif|jpe?g|png|css|js|html))$">
order allow,deny
allow from all </FilesMatch> Options ExecCGI FollowSymLinks Includes MultiViews
RewriteEngine on
# we are reached via /<path-to-ezpublish>/ prefix
RewriteBase /<path-to-ezPublish>/
# first we rewrite the root dir to the handling php script
RewriteRule ^$ index.php [L] RewriteRule ^index\.html$ index.php [L]
# strip out the subdirs when the browser requests us from per dir pages RewriteRule ^.+/<path-to-ezPublish>+/.$ $1 [L]
# and now break the rewriting for local files
RewriteRule ^<path-to-ezPublish>\.php.* - [L]
RewriteRule ^settings\.* - [L]
RewriteRule ^design\.* - [L] RewriteRule ^var\.* - [L]
# anything else is a subdir which gets handled by another php script
RewriteRule !^index\.php.* - [C] RewriteRule (.*) index.php/$1 ********************************************* Its working for me.
Simon http://www.webrak.co.uk
|