Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
subfolder to subdomain redirection
Old 12-12-2007, 03:23 AM subfolder to subdomain redirection
Experienced Talker

Posts: 43
Name: Basty
Trades: 0
Need to redirect my sub folder to subdomain.domain.com using 301 at .htaccess?

Any help is appreciated. Tnx (sorry if I am not on the right thread)
__________________

Please login or register to view this content. Registration is FREE
Jaguar.X.05 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-17-2007, 08:12 AM Re: subfolder to subdomain redirection
Novice Talker

Posts: 12
Trades: 0
Quote:
Originally Posted by Jaguar.X.05 View Post
Need to redirect my sub folder to subdomain.domain.com using 301 at .htaccess?

Any help is appreciated. Tnx (sorry if I am not on the right thread)
It can be done ain a number of ways, probably the simplest is to use a serverside language to set the header to a 301 and redirect the page.

In PHP this would be

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>

Just place that in an index.php file and upload it to the sub-folder.

Heres a page that shows other examples in other languages including this one

http://www.webconfs.com/how-to-redirect-a-webpage.php
__________________

Please login or register to view this content. Registration is FREE
Sam M - Expert in Windows Web Hosting and Web Design and Development.
ServWise.com is offline
Reply With Quote
View Public Profile Visit ServWise.com's homepage!
 
Old 12-23-2007, 10:38 PM Re: subfolder to subdomain redirection
L a r r y's Avatar
Super Talker

Posts: 100
Name: Larry K
Location: Arizona
Trades: 0
Quote:
Originally Posted by Jaguar.X.05 View Post
Need to redirect my sub folder to subdomain.domain.com using 301 at .htaccess?
Redirect permanent /service http://foo2.bar.com/service

If the client requests http://myserver/service/foo.txt, it will be told to access http://foo2.bar.com/service/foo.txt instead.
--Adapted from httpd.apache.org/docs/1.3/mod/mod_alias.html#redirect

Redirect permanent will cause a 301 permanent redirection.

I think this one from out of my .htaccess might be what you need:
I had to use the pair of redirects:
Redirect /list/ http://example.org/lists
Redirect /list http://example.org/lists/

That ensured the url ended with / and not //.
I redirected people going to /list/ to go to /lists/, but you can modify my example:

Redirect permanent /list/ http://example.org
Redirect permanent /list http://example.org/

Edited for clarification last example.

Last edited by L a r r y; 12-23-2007 at 10:44 PM..
L a r r y is offline
Reply With Quote
View Public Profile Visit L a r r y's homepage!
 
Reply     « Reply to subfolder to subdomain redirection
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45924 seconds with 12 queries