Forum Moderators: phranque

Message Too Old, No Replies

RewriteRule: '/foo/file' to '/foo/file.php'

it doesn't work (I get a 404 error)

         

guarriman

5:44 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



Hi.

Working with Apache v1.3.33 on Linux (on a host service).

I want to redirect:
'http://www.mydomain.com/foo/file' to
'http://www.mydomain.com/foo/file.php'

I made on my '.htaccess' within 'http://www.mydomain.com/foo/':
----------
RewriteEngine On
RewriteBase /foo
RewriteRule ^/file /file.php [QSA,L]
------------

But it doesn't work. I get a '404 Error':
------
Not Found
The requested URL /foo/file was not found on this server.
------

What am I doing wrong? Thank you very much.

maccas

5:53 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



Does this work if you put it inside your foo directory?

RewriteEngine On
RewriteRule ^file file.php [QSA,L]

guarriman

3:20 pm on Oct 3, 2005 (gmt 0)

10+ Year Member



It works.

Thank you very much, maccas.