Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions
 Helicon Tech : Common Questions
Subject Topic: Redirect Sub Domain to WWW Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dtnsemprog
Newbie
Newbie


Joined: 10 March 2010
Location: United States
Online Status: Offline
Posts: 19
Posted: 21 July 2010 at 4:12pm | IP Logged Quote dtnsemprog

I am using ISAPI_Rewrite 3.1.0.63.  I am trying to redirect a sub domain to a www, but also trying to redirect specific folders on the sub to specific folder on the www.  Here is what I have in the isapi file on blog.maindomain.com:

RewriteCond %{SERVER_NAME} ^blog\.maindomain\.com$ [NC]
RewriteRule (.*) http://www.maindomain.com/blog$1 [NC,NS,R=301]

RewriteCond %{HTTP_HOST} ^blog\.maindomain\.com$ [NC]
RewriteRule ^category/category/$ http://www.maindomain.com/blog/newcategoryname/newcategoryname/ [NC,R=301,L]

After adding these rules if I go to blog.maindomain.com it DOES redirect me to www.maindomain/blog.

However, when I go to blog.maindomain.com/category/category/
it stays at the sub domain and does not redirect.

Any ideas?

Thank you,
Jon
Back to Top View dtnsemprog's Profile Search for other posts by dtnsemprog
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 22 July 2010 at 1:53am | IP Logged Quote Anton

Here's what it should be:

RewriteBase /

RewriteCond %{SERVER_NAME} ^blog\.maindomain\.com$ [NC]
RewriteRule ^$ http://www.maindomain.com/blog/ [NC,NS,R=301]

RewriteCond %{HTTP_HOST} ^blog\.maindomain\.com$ [NC]
RewriteRule ^category/category/$ http://www.maindomain.com/blog/newcategoryname/newcategoryname/ [NC,R=301,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
dtnsemprog
Newbie
Newbie


Joined: 10 March 2010
Location: United States
Online Status: Offline
Posts: 19
Posted: 22 July 2010 at 11:20am | IP Logged Quote dtnsemprog

Thanks for the reply Anton. Unfortunately, the second rule still does nothing. 
Back to Top View dtnsemprog's Profile Search for other posts by dtnsemprog
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 23 July 2010 at 2:27am | IP Logged Quote Anton

That's weird.
Please enable logging in httpd.conf by putting the following directive:

RewriteLogLevel 9

Then make the problematic request and provide the log records.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
dtnsemprog
Newbie
Newbie


Joined: 10 March 2010
Location: United States
Online Status: Offline
Posts: 19
Posted: 27 July 2010 at 1:37pm | IP Logged Quote dtnsemprog

Thanks for the help Anton, but I went a different way with this.  Client was a bit impatient.
Back to Top View dtnsemprog's Profile Search for other posts by dtnsemprog
 

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