homepage Welcome to WebmasterWorld Guest from 54.237.184.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Full URI in internal 301 redirect
..or is a forward slash OK?
MrWumpus




msg:4166158
 10:35 pm on Jul 7, 2010 (gmt 0)

If I do a 301 redirect in PHP on my own site that merely redirects to the root homepage, must I specify the full URI as in "Location: hxxp://www.mysite.com/" or can I use "Location: /"?

My main concern was how the search engines would behave and whether they required "Location: /" to always be a full URI even when it's happening on my site.

 

g1smd




msg:4166180
 11:17 pm on Jul 7, 2010 (gmt 0)

You need the full URI.

However, redirecting to the root can be a bad idea in many circumstances, especially when it is a large number of pages.

[webmasterworld.com...] [webmasterworld.com...]

Don't forget to also send the HTTP 301 Header before sending the Location header.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved