The MU forums have moved to

Switching domains using htaccess (2 posts)

  1. DarkPepe
    Posted 17 years ago #

    Hi, I've just recently switch my domain name from to (example).

    There is a way of bulding a rewrite rule to make a redirection using the user input url? I'll explain myself:

    I want to be able to redirect users that type to

    Also, if the user has typed something like the redirection takes him to

    ?? I'm trying to understand the documentation of mod_rewrite but is too complicated for me.

    Can anybody give me a little help?

    Thank You Guys.

  2. lunabyte
    Posted 17 years ago #

    Are you 100% sure you want to do that?
    I'm not sure if your MU install is up and running or not, but that is going to affect every user you have.

    Not to mention, for each user you'll have to modify their options table and whatnot to change every instance of to

    This should work, but no guarantees. ;)

    RewriteCond %{HTTP_HOST} ^$ [NC]
    RewriteRule ^(.*)$$1 [R=301,L]

    It's essentially the same for kicking people off of the www subdomain and redirecting them.

    Put that in your htaccess file after the www rewrite rule.

About this Topic

  • Started 17 years ago by DarkPepe
  • Latest reply from lunabyte