Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod rewrite rule not working

Status
Not open for further replies.

keak

Programmer
Sep 12, 2005
247
CA
Hi there,
I am trying to do a redirect to the members sub-folder to another URL and I have the code

Code:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^members*$ [URL unfurl="true"]http://www.domain.com/[/URL]
RewriteRule ^members/$ [URL unfurl="true"]http://www.domain.com/[/URL]

RewriteRule ^old\.html$ new.html

but instead of going to domain.com, it shows an error.

I tried a simple test and it seems to be working fine ....
old.html redirects to new.html


am i doing something wrong here?
 
If you are redirecting to another server domain try adding [R,L] for external redirect and termination rule in the end of the line. Also '*' symbol does not mean a mask for anything in rewrite rules. Use (.*) instead which means any character (dot) multiple or zero times (star). Something like,

Code:
RewriteRule ^members/(.*)$ [URL unfurl="true"]http://www.domain.com/[/URL] [R,L]

Let me know if that does not work. Plus turn on logging and see what's going on, like this

Code:
RewriteLogLevel 3
RewriteLog "/path/to/file"


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top