Reputation: 3162
I switched my website from MODx to Wordpress to a different platform so now I have to make a 301 redirect.
All I need to do is to 301 Redirect http://www.domain.com/page-name.html
to http://www.domain.com/page-name/
.
What lines should I add to my Wordpress .htaccess
file?
.htaccess file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Upvotes: 0
Views: 1226
Reputation: 143946
For just one page, try:
Redirect 301 /page-name.html /page-name/
For everything ending with html, try:
RedirectMatch 301 ^/([^.]+)\.html$ /$1/
Upvotes: 3