Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rewriterule redirect folder

After all of the research, I have not been able to find the answer to this.

On the old website, html files were the format http://www.example.com/folder/file.html I built the new site in wordpress with the url format http://www.example.com/folderfile/ I have had no problem stripping the .html off with a rewriterule, but how can I remove the / after folder? Is there any way to make

http://www.example.com/folder/file.html redirect to http://www.example.com/folderfile/ automatically?

Any advice is appreciated! Thanks!

like image 681
Christian Avatar asked Aug 16 '26 20:08

Christian


1 Answers

Try out this:

RewriteRule ^(.*)/(.*).html$ ./$1$2/ [QSA]
like image 150
Stranger Avatar answered Aug 18 '26 10:08

Stranger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!