Forum Moderators: phranque

Message Too Old, No Replies

How Do I Configure WordPress Code and 301 Code in my .htaccess file?

Having both bits of code in my .htaccess file creates errors.

         

Christyl Stevens

5:57 pm on Apr 25, 2006 (gmt 0)

10+ Year Member



I have a problem trying to combine my 301 redirect code with the new WordPress code in my .htaccess file.

Could somebody please show me how to combine the following 2 pieces of code so that they will both work WITH each other because all I have received so far are errors.

Thanks.

This is the 301 redirect code.

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^mydomain\.com
RewriteRule ^(.*)$ [mydomain.com...] [R=permanent]

And this is the WordPress code.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Christyl

ChadSEO

6:56 pm on Apr 25, 2006 (gmt 0)

10+ Year Member



Christyl,

I have the following in my .htaccess file and it works:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]

Chad