0

I had old html website which had .html pages and i want to redirect to non .html pages which wordpress has.

for eg.

Old site http://myweb212.com/About-Us/jony-test.html

wordpress site.

http://myweb212.com/About-Us/jony-test

There are many pages in website so is this possible do this with one rule?

I tried using a rule but it breaks some of the images of upload folder and shows 404.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301]
RewriteRule . /index.php [L]
</IfModule>
Tim Penner
  • 3,551
  • 21
  • 36
Rakhi
  • 929
  • 15
  • 41

1 Answers1

0

Inserting the new rule between another rule (RewriteRule) and its associated conditions (RewriteCond) breaks this other rule.

So when you move the rule to the beginning or to the end, it should work as is.

One minor nitpick, never test with R=301! When everything works as it should, you may replace R with R=301 (permanent redirect).

Community
  • 1
  • 1
Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198