Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Web Hosting and Domains > Web Hosting Forum

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-29-2008, 09:00 AM
new member
 
Join Date: Jan 2008
Posts: 4
Default www gets removed from my domain name

Hi,

Sometimes*, when I enter my domain name on the address bar of the browser e.g www mydomain com (no . cause I am not allowed to post urls yet), it transforms to mydomain com (the www gets removed). This seams to cause some problems with authentication in Joomla.

Is there a configuration tweak to avoid it? Even better, I would like to automatically add www to the domain names when it is not entered by the user.
I have a whm/cpanel vps account.

Alex

*Edit: It happens when I don't place a / at the end of the address for a directory other than root eg www mydomain com /administrator transforms to mydomain com /administrator when www mydomain com /administrator/ doesn't.

Last edited by alexvts; 05-29-2008 at 09:08 AM.
Reply With Quote
  #2 (permalink)  
Old 05-29-2008, 10:45 AM
new member
 
Join Date: Jan 2008
Posts: 4
Default Add trailing slash (WAS: www gets removed from my domain name)

Found it!

Because the problem occurs when the trailing slash is missing, adding the following to .htaccess solves it

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ h t t p://www mydomain gr/$1/ [L,R=301]

(again no . because I am not allowed to post url yet)

Search for "add trailing slash" to find more on the web

Alex
Reply With Quote
  #3 (permalink)  
Old 06-03-2008, 09:50 AM
Banned
 
Join Date: Jun 2008
Posts: 3
Default Thanks

Hi!

Thanks for your information.
Reply With Quote
  #4 (permalink)  
Old 06-03-2008, 09:59 AM
Senior Member
 
Join Date: Feb 2008
Posts: 205
Default

Well I was going to say it sounds like you have a rewrite on, but yes you found it. That would play havoc with your joomla cookies, so make sure also your cookies in joomla can handle www and no www.

I think you do that by placing a . before the domain name like so .domain
__________________
Midlands Weather Forum
Reply With Quote
  #5 (permalink)  
Old 06-03-2008, 04:45 PM
new member
 
Join Date: Jan 2008
Posts: 4
Default

Quote:
Originally Posted by taramichael View Post
Hi!

Thanks for your information.
np!

Quote:
Originally Posted by optrex View Post
Well I was going to say it sounds like you have a rewrite on, but yes you found it. That would play havoc with your joomla cookies, so make sure also your cookies in joomla can handle www and no www.

I think you do that by placing a . before the domain name like so .domain
I'm new to Joomla so I didn't totally get neither your comment ("you have a rewrite on") nor your suggestion ("placing a . before the domain name"). Since my site seems to work fine (logins and everything) would you say it will be a problem if I just ignore them (I really don't have much time right now) and come back if there is ever a problem or should I hit the books to learn about them?

Alex
Reply With Quote
  #6 (permalink)  
Old 06-04-2008, 11:38 AM
Senior Member
 
Join Date: Feb 2008
Posts: 205
Default

No no, you've dealt with it now, leave it unless you have an issue. My rewrite on comment verified your htaccess issue RewriteEngine On
__________________
Midlands Weather Forum
Reply With Quote
  #7 (permalink)  
Old 06-04-2008, 04:29 PM
new member
 
Join Date: Jan 2008
Posts: 4
Default

Quote:
Originally Posted by optrex View Post
No no, you've dealt with it now, leave it unless you have an issue. My rewrite on comment verified your htaccess issue RewriteEngine On
Ok, thanks!
Reply With Quote
  #8 (permalink)  
Old 06-04-2008, 05:40 PM
Dan's Avatar
Dan Dan is offline
Got root?
 
Join Date: Aug 2007
Location: England, UK.
Posts: 755
Default

Redirect http:// to http://www using .htaccess

For future reference
__________________
Webhosting.UK.com || cPanel VPS Hosting || Reseller Hosting || Support System || Billing System

Sales: 0808-262-0855
Support: 0800-612-8725
International: +44 191 303 8191
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:53 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum