Hey all - I'm running into an issue with an .htaccess file with some 301 redirects. I'm running a server that has a site which has an .htaccess file redirecting several domain names to another single canonical name. Those redirects work great, until you try going to a particular subfolder of a site which starts with an underscore, for example: oldsitedomainname.com/_admin would be redirected to: http://www.newsitedomainname.com/_admin however, it's actually being re-written like this: http://www.newsitedomainname.com_admin which doesn't work for obvious reasons. I added the following code snippet from a 301 howto in order to add a trialing slash to URLs, which seems to work great, but that hasn't solved the problem: rewriteCond $1 !/$ rewriteCond %{REQUEST_FILENAME}/ -d rewriteRule (.+) http://www.newsitedomainname.com/$1/ [R=301,L] Anyone have any suggestions? Thanks in advance!
Wow, so no one uses 301 redirects? Is there another method I could use to perform this same function? Also, I'm running into a problem of the redirects only redirecting non-www addresses. Anytime someone prepends a www to the address, it won't get re-written.
Hi sfunk1x, try this: RewriteCond %{HTTP_HOST} !^www\.newsitedomainname\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule (.*) http://www.newsitedomainname.com/$1 [R=301,L] Maybe it will work. Greetz drieschel