1

I want to rediret

mysite.com/page-url.html/

to

mysite.com/page-url/

How can i do that ?

I tried to create page rule in cloudflare like this

- mysite.com/*.html

to

mysite.com/*

but it's not working.

0

Try using this in Your .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

alternatively You could use in your php code:

 wp_redirect(str_replace('.html', '', $url))
1
  • thanks for your reply. actully i used search & replace plugin and updated .html to /
    – RGM7
    Jan 8 '20 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.