tags:

views:

14

answers:

1

Dear all

U 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
RewriteCond  %{SERVER_PORT} !^8080$
RewriteRule ^(.*)$ http://localhost/IN/$1 [L,R]
RewriteRule ^new.html$ /index.html$1 [L]
A: 

Your first rule will probably cause an infinite rule as the substitute URL doesn’t use the port 8080 neither. So try this:

RewriteCond  %{SERVER_PORT} !^8080$
RewriteRule ^(.*)$ http://localhost:8080/IN/$1 [L,R]

You also need to request /new.html to see if your second rule works. Additionally, there is no first group in your pattern whose match can be referenced by $1. So:

RewriteRule ^new\.html$ /index.html [L]
Gumbo