URL Rewrite and Subdomains

 
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting
View previous topic :: View next topic  
Author Message
Angel
-


Joined: 17 Nov 2003
Posts: 157
Location: Everett, Washington

PostPosted: Mon Apr 02, 2007 10:00 am    Post subject: URL Rewrite and Subdomains Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Apr 02, 2007 5:41 pm    Post subject: Re: URL Rewrite and Subdomains Reply with quote

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 View user's profile Send private message Send e-mail
Angel
-


Joined: 17 Nov 2003
Posts: 157
Location: Everett, Washington

PostPosted: Tue Apr 03, 2007 2:18 am    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Apr 03, 2007 4:29 pm    Post subject: Reply with quote

Angel,

http://www.aprelium.com/abyssws/articles/urlrewriting-tutorial.html should help you start understanding URL rewriting.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Angel
-


Joined: 17 Nov 2003
Posts: 157
Location: Everett, Washington

PostPosted: Wed Apr 04, 2007 6:35 am    Post subject: Reply with quote

Thanks very, very much aprelium :D
_________________
Noize Pollution | Angel's Online | Free Net Builders | Pagan Portal
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Wed Apr 04, 2007 8:37 pm    Post subject: Reply with quote

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 View user's profile Send private message AIM Address
Angel
-


Joined: 17 Nov 2003
Posts: 157
Location: Everett, Washington

PostPosted: Thu Apr 05, 2007 4:15 am    Post subject: Reply with quote

Yes it can But I'm after it without having to stop and add the subdomains to a servers. Thats why I was asking. ;)
_________________
Noize Pollution | Angel's Online | Free Net Builders | Pagan Portal
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3719
Location: USA, GA

PostPosted: Thu Apr 05, 2007 5:41 am    Post subject: Reply with quote

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!
_________________
Computer Programmer & Networking Specialist

Back to top View user's profile Send private message Visit poster's website MSN Messenger
Angel
-


Joined: 17 Nov 2003
Posts: 157
Location: Everett, Washington

PostPosted: Sat Apr 07, 2007 8:22 am    Post subject: Reply with quote

Thanks so Much trust I really appreciate the help :D
_________________
Noize Pollution | Angel's Online | Free Net Builders | Pagan Portal
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
beehive1
-


Joined: 09 Apr 2007
Posts: 1

PostPosted: Mon Apr 09, 2007 10:20 pm    Post subject: directory Reply with quote

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 View user's profile Send private message Visit poster's website MSN Messenger
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Tue Apr 10, 2007 12:24 am    Post subject: Re: directory Reply with quote

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 View user's profile Send private message Visit poster's website
Sulcorp
-


Joined: 12 Mar 2007
Posts: 4

PostPosted: Fri Jan 23, 2009 2:16 pm    Post subject: Reply with quote

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 View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 908
Location: Michigan, USA

PostPosted: Sat Jan 24, 2009 5:45 am    Post subject: Reply with quote

Sulcorp wrote:
can use a variable for the part infront of the name?

%variable%.domain.com

to

domain.com/%variable

???
and if so how?


See http://www.aprelium.com/forum/viewtopic.php?p=76295#76295
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
RedCabana
-


Joined: 14 Sep 2010
Posts: 2

PostPosted: Tue Sep 14, 2010 10:08 am    Post subject: Reply with quote

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 View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> URL Rewriting All times are GMT + 1 Hour
Page 1 of 1

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


Powered by phpBB phpBB Group