Page 2 of 2

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 8:13 pm
by Rolf
opawaldburger wrote: @Rolf: Perfect! That's exactly how it should work! What did you do or not do?
Ahum read the above (uch, the page before ;)), nothing more, nothing less  ;D   (Guestbook 1.1.12 btw)

Did you leave all the changes, or did you set it back again? It is a combination of...

®

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 8:20 pm
by opawaldburger
Could you actually post you (relevant) commands in the .htaccess file? I set back some things and left some... a combination ;)
And in the config.php: how did you set the URL? with www. or without?

thanks again for your help! that's very nice! :)

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 8:24 pm
by Rolf

Code: Select all

# 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

# (this is important, so uncomment if your host permit)
Options -Indexes
ServerSignature Off
#
#Options +FollowSymLinks
#
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /
#
# Link to http://www.website.com then redirect to http://website.com
RewriteCond %{HTTP_HOST} ^www\.atmytestsite\.com [NC]
RewriteRule ^(.*)$ http://atmytestsite.com/$1 [L,R=301]
#
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# but ignore POST requests.
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_METHOD} !POST$
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
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>

Code: Select all

$config['root_url'] = 'http://atmytestsite.com';
®

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 8:48 pm
by opawaldburger
It's like magic - there are the same problems we had before! I copied your .htaccess and replaced atmytestsite whth benjamin-karl. Same with the config.php

It would be SO interessting where the mistake is. Why does it work woth your site...? It's a miracle ;)

greez

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 8:57 pm
by Rolf
opawaldburger wrote: It would be SO interessting where the mistake is. Why does it work woth your site...? It's a miracle ;)
It works for me... Perhaps you have to do a CRTL F5 to refresh your browser...

Rolf

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 9:06 pm
by opawaldburger
tried it in a different browser - stays the same!

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 9:11 pm
by Rolf
Hmm, it works for me...  :-\

Re: Removing www by using .htaccess causes problems

Posted: Mon Mar 15, 2010 9:26 pm
by opawaldburger
oh sorry, I didn't tell you :S
I set back the .htaccess file so that everyone can access the guestbook.

I also noticed something different. When I add the neccessary lines in the .htaccess file to remove the www, the link for the add-entry-button still is shown with www. On your site, the link is shown without www. Added 2 screenshots!

Re: Removing www by using .htaccess causes problems

Posted: Tue Mar 16, 2010 8:45 am
by Rolf
opawaldburger wrote: I also noticed something different. When I add the neccessary lines in the .htaccess file to remove the www, the link for the add-entry-button still is shown with www. On your site, the link is shown without www. Added 2 screenshots!
That is what Dr. CSS said the setting in the config.php root_url.

Please change all the settings discussed before and try to test if it works.
Put a copy of this used .htaccess and the config.php (without the passwords etc.) in here. Perhaps we can give you a pointer in the right direction...

Rolf

Re: Removing www by using .htaccess causes problems

Posted: Tue Mar 16, 2010 4:23 pm
by opawaldburger
Hi Guys!

After owr_bgld sent me a PM, which contained that I should check if the modified config.php was REALLY uploaded, I found out the problem - it wasn't. Somehow I wasn't allowed to rewrite the current one, so I first had to delete it and the uploaded it again!

Thanks a lot to all who helped me with this problem!

Greez,
Opa