WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] SEO Friendly Redirect

[Resolved] SEO Friendly Redirect

  • By harnessing the power of Google I’ve discovered ways to resolve the www vs no-www issue out there. However, which way is (more) correct (than the others)?

    The simplest is:

    Redirect 301 / http://www.yoursite.com/
    (but it has variations like PermanentReidrect?)

    Then I found:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^YourSite\.com [nc]
    RewriteRule (.*) http://www.YourSite.com/$1 [R=301,L]

    What’s the difference between this and the above?

    Which one of these is the standard (or which is better)?

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • bump

    There is no actual difference between the two you posted. They have exactly the same effect and impact. The server will send identical responses in both cases (a 301 permanent redirect).

    However, the first requires that the server be running mod_alias, while the second requires mod_rewrite. Some servers have one, some have the other, some have both. If they have both, then the first one is slightly faster, in theory.

    So if the first one works, use that. If it doesn’t seem to work, try the second one.

    If you’re modifying things, be careful with the first one. Redirect directives can be trickier than they appear. Rewrite rules seem more complex, but they are at least explicit.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] SEO Friendly Redirect’ is closed to new replies.