Author |
Message |
Iyonix
WebHelper
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Mon Jan 20, 2003 10:36 pm (21 years, 11 months ago) |
|
I would I configure my .htaccess so that if a user goes to http://www.whiteplain.com/xyz123 for example it redirects to http://whiteplain.com/xyz123
I want it to do it for what ever there is in place of xyz123 e.g train.php and forum/postmessage.php
Thanks, |
________________________________ Iyonix |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jan 21, 2003 7:16 am (21 years, 11 months ago) |
|
Try this:
Code: | RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ http://domain.com/$1 [R]
|
|
________________________________
Last edited by Daniel on Tue Jan 21, 2003 5:12 pm, edited 1 time in total |
|
|
|
Iyonix
WebHelper
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Tue Jan 21, 2003 1:06 pm (21 years, 11 months ago) |
|
Daniel wrote: | Try this:
Code: | RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ http://domain.com/$1 [R]
|
|
I tried this code and it redirects http://www.domain.com/anyrandompath to http://domain.com/ the latter being without the path
Any way of making it redirect it with the path?
Thanks, |
________________________________ Iyonix |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jan 21, 2003 5:26 pm (21 years, 11 months ago) |
|
I'm really not sure on this one, but try this:
Code: | RewriteEngine On
RewriteCond %{HTTP_HOST} !^domain.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R,L] |
|
________________________________
|
|
|
|
Iyonix
WebHelper
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Tue Jan 21, 2003 6:25 pm (21 years, 11 months ago) |
|
It did exactly the same as before
Could you advise me on where there is any documentation/tutorials on this so that I can try and work it out?
Thanks, |
________________________________ Iyonix |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jan 21, 2003 7:29 pm (21 years, 11 months ago) |
|
Search the net for mod rewrite. I'm just wondering, what kind of a server are you running this on? |
________________________________
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jan 21, 2003 8:01 pm (21 years, 11 months ago) |
|
Iyonix,
I just tried the code I gave the first time, and it works. If it doesn't work it's something server specific.
Daniel |
________________________________
|
|
|
|
Iyonix
WebHelper
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Tue Jan 21, 2003 10:26 pm (21 years, 11 months ago) |
|
Daniel wrote: | Search the net for mod rewrite. I'm just wondering, what kind of a server are you running this on? |
I am using and Apache-AdvancedExtranetServer/1.3.23 |
________________________________ Iyonix |
|
|
|
Iyonix
WebHelper
Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England
|
Posted:
Tue Jan 21, 2003 10:27 pm (21 years, 11 months ago) |
|
Daniel wrote: | Iyonix,
I just tried the code I gave the first time, and it works. If it doesn't work it's something server specific.
Daniel |
OK, thanks for your help. I will try it again and if it doesn't work I will ask the guy who hosts me if he can help me |
________________________________ Iyonix |
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Fri Jan 24, 2003 6:24 pm (21 years, 11 months ago) |
|
if you're still having trouble, check http://www.zoneedit.com/ use that for your DNS, they have just the tool you need to set this up. |
________________________________ It's turtles all the way down... |
|
|
|
|