Welcome to WebmasterWorld Guest from 54.166.224.46

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

[htaccess] transfering from subdomains to directory

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

5+ Year Member



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)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

Jim

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

5+ Year Member



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)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

Jim

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

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

5+ Year Member



because i want to transfer all ink juice to the sub directory from sub domain ...
7:33 pm on Feb 1, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month