4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 http://www.domain.com/ -> http://domain.com/
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Mon Jan 20, 2003 10:36 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Jan 21, 2003 7:16 am (21 years, 3 months ago) Reply with QuoteBack to Top

Try this:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ http://domain.com/$1 [R]

________________________________
Image

Last edited by Daniel on Tue Jan 21, 2003 5:12 pm, edited 1 time in total
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Tue Jan 21, 2003 1:06 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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 Sad

Any way of making it redirect it with the path?

Thanks,

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Jan 21, 2003 5:26 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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]

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Tue Jan 21, 2003 6:25 pm (21 years, 3 months ago) Reply with QuoteBack to Top

It did exactly the same as before Sad
Could you advise me on where there is any documentation/tutorials on this so that I can try and work it out?

Thanks,

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Jan 21, 2003 7:29 pm (21 years, 3 months ago) Reply with QuoteBack to Top

Search the net for mod rewrite. I'm just wondering, what kind of a server are you running this on?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Jan 21, 2003 8:01 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Tue Jan 21, 2003 10:26 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Tue Jan 21, 2003 10:27 pm (21 years, 3 months ago) Reply with QuoteBack to Top

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 Very Happy

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Fri Jan 24, 2003 6:24 pm (21 years, 2 months ago) Reply with QuoteBack to Top

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...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 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.


Page generation time: 0.264384 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme