Reputation: 755
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!
Upvotes: 3
Views: 1409
Reputation: 755
This works well:
RewriteRule ^moreinfo/(.*)$ /moreinfo$1 [R=301]
RewriteRule ^healthsolutions/(.*)$ /healthsolutions$1 [R=301]
Where /moreinfo/ and /healthsolutions/ are the folders
Upvotes: 0
Reputation: 11799
I think all you need is something like this:
RewriteEngine On
RewriteRule .* http://www.example.com/folderfile/ [L]
http://www.example.com/folder/file.html
redirects to
http://www.example.com/folderfile/
Upvotes: 0