without www

Permalink
Hello,
I just re-installed concrete5 (5.6) on my server under the www-map.
Now I want to open de website without the www in front of the webadres.
How can I do that.
Thanks for helping.

jackbasting
 
AliceTtr replied on at Permalink Reply
AliceTtr
Just some mod_rewrite.
Google on it, there are plenty examples.
webpresso replied on at Permalink Reply
webpresso
Hi jackbasting

You could achieve this by modifying something on your webserver.
In your root directory you should find a .htaccess file. Perhaps it's hidden becaus it begins wit a dot - then make it visible with your ftp-tool.

Before you change your .htaccess make a copy of it (backup). If something is going wrong you can rename your backup and undo the changes you made.

You can add the following code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]


Also see this tutorial, perhaps some steps will help you. Its another solution with a less generic way - but also works:
http://www.inmotionhosting.com/support/website/htaccess/force-www-h...

best regards, webpresso
webpresso replied on at Permalink Reply
webpresso
Hi jackbasting

You could achieve this by modifying something on your webserver.
In your root directory you should find a .htaccess file. Perhaps it's hidden becaus it begins wit a dot - then make it visible with your ftp-tool.

Before you change your .htaccess make a copy of it (backup). If something is going wrong you can rename your backup and undo the changes you made.

You can add the following code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]


Also see this tutorial, perhaps some steps will help you. Its another solution with a less generic way - but also works:
http://www.inmotionhosting.com/support/website/htaccess/force-www-h...

best regards, webpresso
AliceTtr replied on at Permalink Reply
AliceTtr
Hmmm...Just copy and paste. Must be not so difficult.
jackbasting replied on at Permalink Reply
jackbasting
It doesn't work yet.
I made an .htaccess file

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

I put it in the folder /domains/vegnieuwvliet.nl/htdocs/www on the webserver.

What am I doing wrong?
typoman76 replied on at Permalink Reply
typoman76
Did you tried what user webpresso suggested with the example code?

You could use this one for your site. Should work.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^vegnieuwvliet.nl [NC]
RewriteRule ^(.*)$ http://vegnieuwvliet.nl/$1 [L,R=301]


Other idea:
Use the cannonical functions which are built in concrete5.
http://documentation.concrete5.org/editors/dashboard/system-and-mai...