Jump to content

.htaccess redirect


Recommended Posts

I have 1 main domain and 1 addon domain. I'd like that when a visitor goes to maindomain.com it redirects to addondomain.com. The problem I'm having is that my addon domain is a subfolder of maindomain.com so I can't just do redirect / http://addondomain.com. It gives me "The page isn't redirecting properly".

Link to post
Share on other sites

What you're looking for is not a redirect, but a rewrite rule. Something like this (but not necessarily this) might work:RewriteEngine onRewriteCond %{HTTP_HOST} addondomain.comRewriteRule (.+) path_to_addondomain/$1I've always found these things require a bit of experiment, both for the new thing and also to make sure you haven't messed up something old. Also, make sure everything works for your linked files, like scripts and stylesheets. Google RewriteRule and apache and see what turns up. The apache docs at apache's website are a thorough reference, but not tutorials.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...