proper .htaccess code for 301 redirect?
-
After much research and help sites, I’m still not able to figure out why my redirect code won’t properly redirect. I have two separate wordpress sites because I have switched domains. I’ve located my htaccess file in my old domain, but I can’t figure out where to paste the redirect code to get it to work. I’ve tried at the very top. This is the redirect code I’m using:
#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ https://ventifashion.COM/$1 [R=301,L]and below is my default htaccess code without adding any redirect attempt in there. Does anyone know the proper coding to have this work correctly? Any help is appreciated. (Old domain is chelseytanisha.com, the new domain is ventifashion.com)
ht access file:
# Use PHP5.4 Single php.ini as default
AddHandler application/x-httpd-php54s .php# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
# END W3TC Browser Cache
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteRule .* – [E=W3TC_ENC:_gzip]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =””
RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
RewriteCond “%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index.html%{ENV:W3TC_ENC}” -f
RewriteRule .* “/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index.html%{ENV:W3TC_ENC}” [L]
</IfModule>
# END W3TC Page Cache core# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
- The topic ‘proper .htaccess code for 301 redirect?’ is closed to new replies.