Reputation: 26317
I have a site in a folder called patients
urls look like this:
http://site.com/patients/post-name
I want to redirect
site.com/patients/post-name → newsite.com/post-name
AND
site.com/patients/ → newsite.com/
I've tried this, but site.com/patients still directs to newsitesite.com/patients
Redirect 301 ^/patients/$ http://www.newsite.com/
Redirect 301 / http://newsite.com/
Does htaccess have some ssort of regex to match just the root of /patients/ and then another one for /patients/whatever-comes-next ?
Upvotes: 0
Views: 481
Reputation: 121829
In general, there are two solutions for "301" POST error:
1) Always add a trailing backslash to your "POST" URL (preferred)
2) Create an "Alias" in your httpd.conf file for the "POST" URL:
In your case, you want a redirect for two purposes. Check out this link (closed as off-topic, but still useful):
Upvotes: 0