Hi I've a credit card applicatoin which utilizes opencart. I must create a 301 reditect just in case the consumer types http://mysite.com. To become rerouted in http://www.mysite.com (301 status code)

Here's my .htaccess content:

#Options +FollowSymlinks

RewriteEngine On


RewriteCond % !-f

RewriteCond % !-d

RewriteRule ^(.*) index.php


RewriteEngine On

RewriteBase /

RewriteCond % !^www.mysite.com$ [NC]

RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]

It's doing 302 redirect.

Thanks, Granit

I believe all that you're thinking of doing is inside your Apache config file.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]

I personally use such as this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.net
RewriteRule ^(.*)$ http://www.mysite.net/$1 [R=permanent,L]