Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: Redirect from one directory to another Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 27 August 2008 at 9:52pm | IP Logged Quote waynem

I would like to redirect any requests to:

http://subdomain.domain.com/directory/

to

http://domain.com/directory/

for every file beneath that directory, including database pages if possible i.e. from a forum

I am moving the forum application up one level

Assuming there is a rule to do this, can I then delete the files from the first URL under directory as a request to http://subdomain.domain.com/directory/filename.asp will be redirected to http://domain.com/directory/filename.asp without needing the actual file or subdirectory to exist in the old location?

Back to Top View waynem's Profile Search for other posts by waynem
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7598
Posted: 28 August 2008 at 4:31am | IP Logged Quote Lexey

RewriteCond Host: subdomain\.domain\.com
RewriteRule /directory(/.*) http\://domain.com$1 [I,RP]
Back to Top View Lexey's Profile Search for other posts by Lexey
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7598
Posted: 28 August 2008 at 4:32am | IP Logged Quote Lexey

Quote:
Assuming there is a rule to do this, can I then delete the files from the first URL under directory as a request to http://subdomain.domain.com/directory/filename.asp will be redirected to http://domain.com/directory/filename.asp without needing the actual file or subdirectory to exist in the old location?


Yes, you could remove old files.
Back to Top View Lexey's Profile Search for other posts by Lexey
 
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 28 August 2008 at 8:13am | IP Logged Quote waynem

Thanks!
Back to Top View waynem's Profile Search for other posts by waynem
 
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 28 August 2008 at 4:30pm | IP Logged Quote waynem

Is there a way to also set this as a permanent move to the search engines?
Back to Top View waynem's Profile Search for other posts by waynem
 
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 28 August 2008 at 4:52pm | IP Logged Quote waynem

oh, and also, you can access the directory like this:

http://domain.com/subdomain/directory or

http://www.domain.com/subdomain/directory

can I rewrite that to:

http://domain.com/directory

?

Back to Top View waynem's Profile Search for other posts by waynem
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7598
Posted: 07 September 2008 at 4:43pm | IP Logged Quote Lexey

The given rule already performs a permanent redirection.

As for the 2nd question, try this:

RewriteCond Host: (?:www\.)?domain\.com
RewriteCond METHOD GET|HEAD
RewriteRule /subdomain(/.*) http\://domain.com$1 [I,RP]
Back to Top View Lexey's Profile Search for other posts by Lexey
 
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 07 September 2008 at 7:12pm | IP Logged Quote waynem

Thanks, Lexey, I appreciate how helpful you guys are on on here.
Back to Top View waynem's Profile Search for other posts by waynem
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum