Page 1 of 1

Cannot login after changing .htaccess in order to include "www"in urls (Solved)

Posted: Thu Jan 15, 2009 10:21 pm
by avatar
Hi Guys,

I am running cmsms 1,5,1 on apacheserver under php4.3 and mysql and this cms system is the best ever, did not used dreamweaver anymore:) So it workes just fine until the following step were made:

I discovered that google didnt like duplicate content so I wanted all the urls have "www"included. I switched a old .html site to cmsms and therefore I have made a 301 redirectlist in my .htaccess file so all the pages are redirected in the right way. Also I put the following command in .htaccess right under the rule "RewriteEngine on" in order to fix the "www"issue :

RewriteCond %{HTTP_HOST} ^mydomain.nl [NC]
RewriteRule ^(.*)$ http://www.mydomain.nl/$1 [L,R=301]   (of course I have changed "my domain in the right name of the domain"  ;))

(i tried to put this command on different places in .htaccess but then the "www" problem isnt solved, the only way to let that work is this exact location in htaccess.
Also I use the internal pretty urls of cmsms

Could this be the couse that I cannot login to the admin login page anymore? The login page appear just as usually, but after entering a username and password and then hit the button nothing happens, the screen seems to refresh a seccond but a empty admin loginpage appears, and again and again and again......so my site is just fine at the moment but manage any content is not possible.

Anyone familliar with this fenomena?

Maby I have to change something in the admindata in cmsms for this page? If the data (username and password) is sent from this page wich includes now the "www" I dont know.... ???

(excuse me 4 the bad english) 

Hope someone knows what I have to do to fix this issue... I would be very grateful...

Thanks for eading anyway!

Regard from Holland

Re: Cannot login after changing .htaccess in order to include "www"in urls

Posted: Thu Jan 15, 2009 11:42 pm
by Pierre M.
Hello,

rework your canonical hostname rewriting rule on non CMSms, static, old page.html URLs first.
When it works merge the CMSms provided .htaccess sample.

Pierre M.

Re: Cannot login after changing .htaccess in order to include "www"in urls

Posted: Fri Jan 16, 2009 9:52 am
by avatar
Hi Piere,

Thanks for this reply,

I try to rewrite this, but my knowledge about programming lets me down in .htaccess. I going to study on this file al lot...

Below is the .htaccess file that I use, this way it works as it supose to do, however loggin in does not work. When I remove the rule (italic) loggin in works fine..hower the www's are not included in the urls...

# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
#
Options -Indexes
ServerSignature Off
Options +FollowSymLinks
#



RewriteEngine on

RewriteBase /
RewriteCond %{HTTP_HOST} !^www.mydomain.nl$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.nl/$1 [L,R=301]

#
#Sub-dir e.g: /cmsms/
RewriteBase /
#
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash

RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


Re: Cannot login after changing .htaccess in order to include "www"in urls (Solved)

Posted: Sun Jan 18, 2009 10:12 pm
by avatar
Okey I've  just swiched to .domain.com  cannot get it work with the www included.  >:(

But so far so good , it works for now, and no duplicate content anymore. ;D 

I am going to study a lot on that .htacces file...

Thanks for the tips Pierre!

Regards 2 all

Re: Cannot login after changing .htaccess in order to include "www"in urls (Solved)

Posted: Sun Jan 18, 2009 10:34 pm
by JeremyBASS
cheack your config.php

you may need to do this...

Document root as seen from the webserver.  No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
$config['root_url'] = 'http://www.domainname.com';
cheers
jeremyBass

*****eidt and try
RewriteCond %{HTTP_HOST} !^www\.domainname\.com [NC]
RewriteRule ^(.*)$ http://www.domainname.com/$1 [R=301,L]
[R=301,L]

was backwards

Re: Cannot login after changing .htaccess in order to include "www"in urls

Posted: Wed Jan 21, 2009 9:01 pm
by Pierre M.
avatar wrote: ...
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

No RewriteRule here ? See the htaccess sample in the /doc directory.

Pierre M.