Grow your CSS skills. Land your dream job.

.htaccess 301 redirect vs rewriteRule?

  • # February 8, 2013 at 2:27 pm

    Hello. I’ve changed domains and have almost finished moving it all. 800+ pages. Took me awhile. The folder structure has changed in the new domain. So it will make this easy. I simply want to take all traffic from the old domain and redirect it to the root of the new domain. Now my only question that remains is which way is better?

    Redirect…

    Redirect 301 / http://www.example.com/

    Or rewriteRule…

    Options +FollowSymLinks
    RewriteEngine on
    #
    RewriteCond %{HTTP_HOST} !^www.newdomain.com
    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

    Anyone have any knowledge about this? Only forums I know that do don’t like answering these redirect questions as they have seen them a lot.

    Thanks!

    Eric, W

    # February 8, 2013 at 2:51 pm

    301 is basically for users who do not have mod_rewrite. Either way is fine.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".