View Single Post
Old 01-17-2013, 10:25 AM   PM User | #1
jeddi
Senior Coder

 
Join Date: May 2006
Posts: 1,512
Thanks: 26
Thanked 4 Times in 4 Posts
jeddi has a little shameless behaviour in the past
Problem with an added "www" ??

Hi,

Not sure if this is a PHP problem.

I have set up a site which produces a webpage.

eg villarentfethiye.simpg.net

So an example page is:

Villa Rental

The page is converted to :

http://simpg.net/info.php?a=villarentfethiye

by the .htaccess file.

This is the code:
Code:
RewriteCond %{HTTP_HOST} ^(.+).simpg.net [NC]
RewriteCond %{HTTP_HOST} !=www.simpg.net [NC]
RewriteRule ^.*$ http://simpg.net/info.php?a=%1 [NC,QSA,L]
The problem is that some browsers apparently add a
"www" to the front of the url automatically.

So when they put "villarentfethiye.simpg.net" into the browser bar
it tries to find "www.villarentfethiye.simpg.net"

and then the system produces an error
saying it can not find the page because it is tryying to
locate: http://simpg.net/info.php?a=www.villarentfethiye
which does not exist

I am not sure of the best way to deal with this.

Some thoughts ... ?

Thanks.


.
__________________
If you want to attract and keep more clients, then offer great customer support.

Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
jeddi is offline   Reply With Quote