Force traffic to root/main domain

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 21 Jul 2014, 09:12

Force traffic to root/main domain

21 Jul 2014, 09:18

Hello - Is there a way to force all website traffic to main domain when a subdirectory is typed in. For example:

User goes to www.sub.domain.com/123
I then want to redirect them to www.sub.domain.com

Thanks!

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Force traffic to root/main domain

21 Jul 2014, 23:58

Sure,

But let me ask you. Do you want to redirect to the root of the sub-domain? Do you want to redirect any first-level folder? not sub-folders?

Regards

User avatar
Posts: 5
Joined: 21 Jul 2014, 09:12

Re: Force traffic to root/main domain

22 Jul 2014, 07:26

Thanks for getting back to me! I probably should have explained this better, it's actually opposite. I want all web users to be able to type www.domain.com but all web content is actually www.domain.com/ABC. So technically redirecting them to the content in sub-folder ABC.

Thanks!

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Force traffic to root/main domain

22 Jul 2014, 15:49

Hello,

Please, try using the following:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond ${HTTP:Host} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/ABC/$1 [NC,R=301,L]


Regards

User avatar
Posts: 5
Joined: 21 Jul 2014, 09:12

Re: Force traffic to root/main domain

22 Jul 2014, 16:03

Hello Andrew,

I emailed support about this - are you able to help with email I sent to support? Or you don't work for Helicon?

Thanks!

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Force traffic to root/main domain

22 Jul 2014, 22:51

I do, but you know the ticketing systems.. someone my have grabbed it. I can't find it.
Did you try the rule? What was the result? The best way is to troubleshoot this with rewrite.log. Logging is described in FAQ - http://www.helicontech.com/forum/10648-FAQ.html


Regards

User avatar
Posts: 5
Joined: 21 Jul 2014, 09:12

Re: Force traffic to root/main domain

23 Jul 2014, 07:41

Thanks and yes I believe I got it to work! Thanks!

User avatar
Posts: 92
Joined: 01 Dec 2012, 14:22

Re: Force traffic to root/main domain

23 Jul 2014, 12:48

If you don't want users to ever serve content from the root, why not just change the path in IIS? Or am I missing something?

User avatar
Posts: 5
Joined: 21 Jul 2014, 09:12

Re: Force traffic to root/main domain

23 Jul 2014, 12:55

We use helicon for a specific application and the support for that app told me to edit the helicon statement, so I started with that. My next step would have been IIS. Thanks for feedback!

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests