tags:

views:

63

answers:

4

Dear all

i have used rewrite url module but not able to redirect to the target page and I am getting error as The requested URL /old.html was not found on this server.

here is my code. Please see to that and suggest to me

RewriteEngine On RewriteRule ^old.html$ new.html [R]

+1  A: 

Is AllowOverride set to All in your httpd.conf? Like this:

   AllowOverride All

Also, your .htaccess should inlcude the L modifier for the last rule, and if you really want to redirect permanently, R=301:

RewriteEngine On 
RewriteRule ^old.html$ /new.html [R=301,L]
Residuum
`AllowOverride FileInfo` suffices.
Gumbo
Thank u .Its works
Ayyappan Swaminathan
A: 

Try also setting the RewriteBase to / like so

RewriteBase /
xav0989
A: 

i am also Try this code for

RewriteEngine On

RewriteBase /

RewriteRule ^old.html$ /new.html [R=301,L]

error as The requested URL /old.html was not found on this server.

How to check the load module in apache server

Ayyappan Swaminathan
A: 

You need to escape the . in .html with a \

So its:

RewriteEngine on
RewriteRule ^old\.html$ new.html [R]
Chacha102