View previous topic :: View next topic |
Author |
Message |
Angel -
Joined: 17 Nov 2003 Posts: 157 Location: Everett, Washington
|
Posted: Mon Apr 02, 2007 10:00 am Post subject: URL Rewrite and Subdomains |
|
|
I have a Wildcard DNS and since I know pretty much nothing of URL rewriting I was wondering if it is possible to have a person redirected to a subfolder based on the subdomain requested.
example
Code: | http://ANYTHING.MySite.com gets redirected to http://mysite.com/ANYTHING
http://ANYTHINGELSE.MySite.com gets redirected to http://mysite.com/ANYTHINGELSE
|
if so how would I do this?
thanks in advance,
Angel _________________ Noize Pollution | Angel's Online | Free Net Builders | Pagan Portal |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Mon Apr 02, 2007 5:41 pm Post subject: Re: URL Rewrite and Subdomains |
|
|
Angel,
Your should write a URL rewriting rule which uses the HTTP_HOST variable value. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Angel -
Joined: 17 Nov 2003 Posts: 157 Location: Everett, Washington
|
Posted: Tue Apr 03, 2007 2:18 am Post subject: |
|
|
Thanks aprelium but are there some tutorials on URL rewriting because to tell you the truth I'm completly lost. I mean I understand the basic concept of what URL rewrite is but I don't know anything about writing rules or anything like that. I'm just plain stumped. _________________ Noize Pollution | Angel's Online | Free Net Builders | Pagan Portal |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
|
Back to top |
|
|
Angel -
Joined: 17 Nov 2003 Posts: 157 Location: Everett, Washington
|
|
Back to top |
|
|
hc2995 -
Joined: 07 Aug 2006 Posts: 644 Location: Maryland, USA
|
Posted: Wed Apr 04, 2007 8:37 pm Post subject: |
|
|
Could'nt this also be done with a subdomain? I think some services out there offer it (zoneedit.com does lol) _________________ Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P |
|
Back to top |
|
|
Angel -
Joined: 17 Nov 2003 Posts: 157 Location: Everett, Washington
|
|
Back to top |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Apr 05, 2007 5:41 am Post subject: |
|
|
Hello Angel,
Try the following URL Rewrite settings and it should work.
{Rule Number 1}
Virtual Path Regular Expression: ^(.*)$
Conditions
Variable: HTTP Header: Host (HTTP_HOST)
Operator: Matches with
Regular Expression: ^anything\.mysite\.com$
If this rule matches: Perform an external redirection
Redirect to: http://mysite.com/anything
Status Code: Choose a status code
{Rule Number 2}
Virtual Path Regular Expression: ^(.*)$
Conditions
Variable: HTTP Header: Host (HTTP_HOST)
Operator: Matches with
Regular Expression: ^anythingelse\.mysite\.com$
If this rule matches: Perform an external redirection
Redirect to: http://mysite.com/anythingelse
Status Code: Choose a status code
Now just apply the settings!
Note: You need two seperate rules to do this. Enjoy! |
|
Back to top |
|
|
Angel -
Joined: 17 Nov 2003 Posts: 157 Location: Everett, Washington
|
|
Back to top |
|
|
beehive1 -
Joined: 09 Apr 2007 Posts: 1
|
Posted: Mon Apr 09, 2007 10:20 pm Post subject: directory |
|
|
Hello
I have the same questions as talked about in this thread. my only other question is can you specify a directory or what directory do yo put your web pages in. I am new to all of this and would appreciate any help.
Thanks |
|
Back to top |
|
|
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Tue Apr 10, 2007 12:24 am Post subject: Re: directory |
|
|
beehive1 wrote: | Hello
I have the same questions as talked about in this thread. my only other question is can you specify a directory or what directory do yo put your web pages in. I am new to all of this and would appreciate any help.
Thanks |
Yes, Console, Configure > General then change the location. OK > Restart, enjoy. :-) _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
|
Sulcorp -
Joined: 12 Mar 2007 Posts: 4
|
Posted: Fri Jan 23, 2009 2:16 pm Post subject: |
|
|
can use a variable for the part infront of the name?
%variable%.domain.com
to
domain.com/%variable
???
and if so how? |
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 952 Location: Michigan, USA
|
|
Back to top |
|
|
RedCabana -
Joined: 14 Sep 2010 Posts: 2
|
Posted: Tue Sep 14, 2010 10:08 am Post subject: |
|
|
I am very new to URL rewriting and I found this post very informative. Thanks for sharing your thoughts and providing very precise answers to the questions. |
|
Back to top |
|
|
|