Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine On
#exampleone.com
RewriteCond %{HTTP_HOST} ^(www\.)?exampleone.com$ [NC]
RewriteCond %{REQUEST_URI} !^/exampleone_folder/(.*)
RewriteRule ^(.*) /exampleone_folder/$1 [L] http://exampleone.com/exampleone_folder in that it *doesn't* redirect in that case. I still want the redirect to happen, and I think it's the REQUEST_URI line that needs to change, but nothing I've tried has worked. http://exampleone.com/subfolder/ redirects how I'd expect it to. http://exampleone/com/subfolder (no trailing slash) doesn't work the same way. There's plenty of example code for fixing this in .htaccess files, but I'm struggling to apply that to my redirects.
Options +FollowSymLinks -MultiViews
RewriteEngine On
#
# Internally rewrite all "add-on" domains to subdirectories under "/add-ons"
RewriteCond %{HTTP_HOST} !^(www\.)?your-main-domain\.com
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+\.([a-z]{3,6}|co\.[a-z]{2}))\.?(:[0-9]+)?$
RewriteCond %{REQUEST_URI} !^/add-ons/
RewriteRule ^(.*)$ /add-ons/%2/$1 [L]
http://example.com/aboutus/ just works. http://example.com/aboutus (no trailing slash) redirects the browser to http://example.com/add-ons/example.com/aboutus/