homepage Welcome to WebmasterWorld Guest from
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

[htaccess] transfering from subdomains to directory

 5:38 pm on Jan 30, 2009 (gmt 0)

i want to transfer from forum.example.com to example.com/forum

how can i setup a htaccess file which will redirect all of the my subdomains pages to this directory pages?



 8:01 pm on Jan 30, 2009 (gmt 0)

Please see this current thread on an almost-identical subject: [webmasterworld.com...]



 9:13 am on Jan 31, 2009 (gmt 0)

thank you for mentioning great resource.

and what if i don't want rewrite the URL, but want to redirect all traffic from sub domain to sub directory via 301 redirect

means from [forum.example.com...]
to example.com/forum/showthread.php?tid=124


 2:51 pm on Jan 31, 2009 (gmt 0)

I'm not sure why you would want to redirect instead of rewrite -- Redirecting will expose the long, ugly, and complicated subdirectory URL to both users and search engines. Most Webmasters would prefer an internal rewrite, which simply tells the server where to find the content to deliver when the subdomain is requested.


[edited by: jdMorgan at 2:51 pm (utc) on Jan. 31, 2009]


 1:34 pm on Feb 1, 2009 (gmt 0)

because i want to transfer all ink juice to the sub directory from sub domain ...


 7:33 pm on Feb 1, 2009 (gmt 0)

WHy would you want to do that? Leave the links and their juice pointing to the URL subdomain.example.com, and simply serve the files stored in the subdirectory when those subdomain URLs are requested. With an internal rewrite, the URL stays the same (subdomain.example.com) and the server just gets the files from the subdomain's assigned subdirectory. There is no reason to tell the search engines or your users *where* the files are stored inside your server, and doing so would make the URLs longer, harder to read and type, and ugly.

This would be sort of like redirecting www.example.com/ to www.example.com/www/user-name/public/html/index.php just because that is the real path in the server's filesystem where the home page of the site is located. There is no reason to do this. Don't do this. Just rewrite subdomain requests to the proper place where the server should get the files, and don't tell the client at all.

The whole point of an internal rewrite is that the URL and the filepath are two different things, and don't even need to resemble each other. Web clients care about URLs, not filepaths.


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