Thursday, January 22, 2009

301 Permenant Redirects in Apache on CentOS

Hello and welcome back to 301 Redirects and you.  You might remember that I did a post on 301 Redirects on IIS a few years ago, way back in 2007 actually.

Today we are concerned with the Apache web server and doing SEO / SSL friendly 301 redirects for to

If you are just running and not using any named virtual hosts you can do:
RewriteEngine on
RewriteRule ^/(.*)$1 [L,R=301]

If you are running named virtual hosts you can then add the directives below to your virtual hosts.

<VirtualHost *:80>
       Redirect 301 /

No comments: