|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
One thing that pops up every so often is errors with cookies due to users accessing your forum without accessing it through the "www" subdomain (yoursite.tld versus www.yoursite.tld), all works until they go to do something that requires you to be logged in. When they send a request to the www subdomain they're told that they need to log in again, and they are *technically* logged in, the cookie doesn't transverse to the www subdomain as they haven't logged into it. This is easy to fix, and takes only a few minutes. Basically you nerf the ability for them to even access your site without the "www" subdomain, if they do, it'll simply forward their request to the www subdomain, which will include logging in, so there shoudln't be any issues with logging in or preforming any tasks that rely on cookies being set for a specific domain. Add the following to your . htaccess file: RewriteCond %{HTTP_HOST} ^yoursite.tld$
RewriteRule ^(.*) http://www.yoursite.tld/$1 [QSA,L,R=301] You would add the same two lines for each domain on your site, mine is: # Redirect non-www URLs to WWW
RewriteCond %{HTTP_HOST} ^undergroundnews.com$
RewriteRule ^(.*) http://www.undergroundnews.com/$1 [QSA,L,R=301]
RewriteCond %{HTTP_HOST} ^undergroundnews.net$
RewriteRule ^(.*) http://www.undergroundnews.net/$1 [QSA,L,R=301]
RewriteCond %{HTTP_HOST} ^undergroundnews.org$
RewriteRule ^(.*) http://www.undergroundnews.org/$1 [QSA,L,R=301]
RewriteCond %{HTTP_HOST} ^undergroundnews.info$
RewriteRule ^(.*) http://www.undergroundnews.info/$1 [QSA,L,R=301]
RewriteCond %{HTTP_HOST} ^ugnsecurity.com$
RewriteRule ^(.*) http://www.ugnsecurity.com/$1 [QSA,L,R=301]
If you don't have a . htaccess file, you can just create one (named . htaccess) and upload it to your web root directory. It's a good idea to ensure you don't already have one before just adding a new one to your site. Also keep in mind that in unix/linux items prefixed with a "." are signified as hidden, so be sure your ftp client is listing hidden files when you go to edit your . htaccess file. It'd also be good to note that this only works in apache (to the best of my knowledge).
|
|
|
|
Joined: Jun 2006
Posts: 3,837
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,837 |
Or this can be put into the vhost.conf file (or similar) - personally I prefer this outside of the .htaccess file.
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
'eh sure if they can ACCESS their vhosts.conf or httpd.conf; was mainly drawn up as is for users who aren't on a dedicated/vps box.
|
|
|
|
Joined: Jun 2006
Posts: 3,837
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,837 |
indeed - was just mentioning an alternative, which in my view is better if that option exists.
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
True, I have a VPS (well, work with several) and like to do all site specific configurations through .htaccess versus making changes in the httpd.conf; no real reason other than I don't have to restart apache after a bunch of changes...
|
|
|
0 members (),
1,083
guests, and
203
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|