apache - htaccess url rewrite .html page version to non .html version (bug :www.http//) -


this question has answer here:

i want redirect old pages (mywebsite.com/help.html) (mywebsite.com/help).

so added code in .htaccess file:

rewriteengine on rewritebase / rewritecond %{the_request} ^[a-z]{4,}\s([^.]+)\.html [nc] rewriterule ^ %1 [r,l,nc] 

it's working strange issue when try url:

mywebsite.com/page.html

i result

www.http//mywebsite.com/page/

you can see url rewrite adding invalid code in start of page url (((www.http//))

try one:

rewritecond %{request_filename}.html -f   rewriterule !.*\.html$ %{request_filename}.html [l] 

took how hide .html extension apache mod_rewrite


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -