Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

htaccess rewrite

Started by x, December 16, 2005, 11:42:35 PM

Previous topic - Next topic


i'm trying to create a rewrite rule so that when someone tries to access a file in a directory (say it does a rewrite and gives them the contents of a specified php file with a that uses a query string (say

I wrote the following:

RewriteEngine on
RewriteRule ^/directory/(.*)$ phpfile.php?file=$1 [nc]

but i just keep getting a 404 error when i try but it works fine when i try

any ideas? thanks

webzone (archived)

Never start a RewriteRule pattern with a /, that was your problem.

RewriteRule ^/directory/(.*)$ phpfile.php?file=$1 [nc] should be
RewriteRule ^directory/(.*)$ phpfile.php?file=$1 [nc]