Sign in to follow this  

301 Redirect

Recommended Posts

I am just wondering about a 301 redirect.

I often saw it done like this:

"Redirect 301 /about.htm"

That works, but so does this:

"Redirect 301 /about.htm /about.php"

Does it matter how it's done?  I am just wondering why I also saw it the first way with the full URL?

Share this post

Link to post
Share on other sites

You really only need to include the full or "Absolute" URL if you're redirecting to a new domain; otherwise, the "Relative" path is assumed on your existing domain.


# Redirect to a URL on a different host
Redirect "/service" ""

# Redirect to a URL on the same host
Redirect "/one" "/two"

I suspect that a lot of folks assume that by including the Absolute URL they're gaining an SEO advantage, but that's not true - Apache, for example automatically adds the Base URL if it's not included. 

It's for this same reason that it's always better to use relative URL's everywhere on your site rather than Absolute ones - they simply assume the "Base" URL and it's automatically included. 

Share this post

Link to post
Share on other sites

Thanks, that makes sense, but it also brings up another question.  Do you need quotes?  All of my redirects contain no quotes around the URL.

Should I go and put quotes around all of them?  Or does it not matter?

Redirect 301 /about.htm /about.php


Redirect 301 "/about.htm" "/about.php"


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.