This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions (Forum Locked Forum Locked)
 Helicon Tech : Common Questions
Subject Topic: Redirect Sub Domain to WWW
Author
Message |
dtnsemprog
Newbie


Joined: 10 March 2010
Location: United States
Posts: 19
Posted: 21 July 2010 at 4:12pm

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
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 22 July 2010 at 1:53am

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
 
dtnsemprog
Newbie


Joined: 10 March 2010
Location: United States
Posts: 19
Posted: 22 July 2010 at 11:20am

Thanks for the reply Anton. Unfortunately, the second rule still does nothing. 
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 23 July 2010 at 2:27am

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
 
dtnsemprog
Newbie


Joined: 10 March 2010
Location: United States
Posts: 19
Posted: 27 July 2010 at 1:37pm

Thanks for the help Anton, but I went a different way with this.  Client was a bit impatient.
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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