PDA

View Full Version : Forum redirecting to mydomain.com with out www


henrysommer
03-07-2008, 01:49 PM
Whenever I type in http://www.mydomain.com/forum, it sends me to http://mydomain.com/forum.

I'm trying to write some PHP that checks if a user is logged in, but of course it doesn't track it properly when I change subdomains like that.

So as I go back to my file I'm going to http://www.mydomain.com/logged_in.php, and the cookies were set for http://mydomain.com.

Checked everything in the admin cp, it has the leading www in front of it.

Any suggestions on how to fix this subdomain/redirecting issue?

shovel
03-07-2008, 01:59 PM
Do you have an .htaccess performing a rewrite on the domain?

henrysommer
03-07-2008, 02:33 PM
Only if vBulletin sets that up naturally.

I don't see .htaccess files, but I'm not in a shell, so I may not be able to see everything in the directory.

shovel
03-07-2008, 02:49 PM
Alright, well let's look at it this way. You navigate to the www. While logged off, what do the links look like on the index page? Are they all www or just the domain.com?

vinzphua
03-08-2008, 04:38 AM
If your hosting account comes with CPanel, you can use the File Manager in there to get to the .htaccess file.

If you cannot get into the .htaccess file. Get you WebHost to set it up so that all requests for mydomain.com permanently redirects to www.mydomain.com.

Alternatively, run your site without the 'www'. Then go into AdminCP, vBulletin Options-> SiteName / URL / Contact Details and change the Forum URL and Home Page URL so they don't have 'www'. If you have other web software, they'll need looking at too.

R1lover
03-08-2008, 05:01 PM
change the forum name/location in vb options. :)