0

I have a strange problem here.

I am using a directory script running off PHP.

The users have the option to type in their postcode so the directory can use their postcode to find local businesses.

I am using a session to save their postcode.

The problem is when the session postcode ($_SESSION['postcode']) doesn't show when I leave out the "www." in the domain. How can I set it so the postcode will show with/without the www.?

Thanks Peter

Peter Stuart
  • 2,362
  • 7
  • 42
  • 73

2 Answers2

2
session_set_cookie_params(0, '/', '.domain.com');
Ali Demirci
  • 326
  • 2
  • 11
0

I used the following code and it worked :)

RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^www.mywebsite.org RewriteRule ^(.*)$ http://mywebsite.org/$1 [R=permanent,L]

Peter Stuart
  • 2,362
  • 7
  • 42
  • 73