Forum Moderators: phranque
www.domain.com/directory1/file1.php
to point to:
www.domain.com/directory1/index.php?file=file1
To start, we created a .htaccess file inside of directory1 (the mod_rewrite module is loaded into apache).
The file looks like this:
=======
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#RewriteBase /directory1/
#RewriteCond %{REQUEST_FILENAME}!-s
#RewriteRule directory1/([a-z]+)\.php$ [domain.com...]
#RewriteRule directory1/([^.][a-z]+)\.php$ [domain.com...] [L]
RewriteRule ^([^/]+)/([^.]+)\.php$ directory1/index.php?file=$2 [L]
</IfModule>
=======
The commented out lines are various rules we've tried with and failed. When attempting to access www.domain.com/direcotory/file1.php it simple responds with a 404 saying file1.php is not found.
This is our first attempt at using mod_rewrite so any help would be appreciated.
Thank you.