www redirection

rgb192
rgb192 used Ask the Experts™
on
redirect http://website.com to http://www.website.com for every page


using php only (on httacess)

is it bad for search engine optomization to just use php to redirect to www
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Some sample code to perform the redirect can be found here: http://stoutlabs.com/blog/view/using_htaccess_to_always_have_the_www_in_your_urls
As the writer mentions it's actually better to not have www. Search engines are smart enough these days to know that the www sub domain is the same as leaving it out and generally ignores it.
Erdinç Güngör ÇorbacıPHP Development Team Leader
Commented:
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule ^(.*)$ http://www.example.com/$1 [QSA, R=permanent,L]




QSA carries Querystring ...

Author

Commented:
How do I do this in windows os
Announcing the Winners!

The results are in for the 15th Annual Expert Awards! Congratulations to the winners, and thank you to everyone who participated in the nominations. We are so grateful for the valuable contributions experts make on a daily basis. Click to read more about this year’s recipients!

You mentioned you were using htaccess. You need to modify your .htacess file and add the code you require to redirect all your users.
Erdinç Güngör ÇorbacıPHP Development Team Leader

Commented:
window has not any differences for usage.

just enable modrewrite engine from apache config if required.

Author

Commented:
thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial