Hello,
I am running a new web site and have chosen the no-www version, and have implemented it in my .htaccess.
All is fine, for
http://www.myhobby.example.org goes to
http://myhobby.example.org, with a 301 permanent redirect.
To accomplish this I use:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^myhobby.example.org$ [NC]
RewriteRule ^(.*)$ http://myhobby.example.org/$1 [L,R=301]
I imagine, however, that webmasters are going to link to my site at
www.myhobby.example.org and I get no link credit for these links, while others link to myhobby.example.org and I do get credit for their links, correct?
Anyway, I can change the RewriteRule to point to a different page on my web site, say,
Code:
RewriteRule ^(.*)$ http://myhobby.example.org/www/$1
but with some way to pass $1 to a php script there, which would first advise visitors that the correct link is http://myhobby.example.org/$1,
then redirect them there.
The idea is, that a webmaster installs a new link, then tests it, and it says here "No WWW! The correct link here is
http://myhobby.example.org/bowling/, to which you will be redirected. if your browser does not redirect you please click the link."
Thanks ever so much!