php - How to rewriting URL with HTACCESS -


this question has answer here:

this line of code on htaccess file

rewriterule ^([^\.]+)$ details.php 

and working fine url

example.com/shiv-sales-corporation 

now want add .html @ end of url

example.com/shiv-sales-corporation.html 

i have changed htaccess code this

rewriterule ^([^\.]+)\.html$ view_details.php 

but other pages or links conflicting after it, kindly me please!

note: "shiv-sales-corporation" slug fetching database, changed randomly other link on page. examples:

example.com/ibm  example.com/apple-corp  example.com/himalaya-ltd 

hope work you:

rewriterule ^([^\.]+)([\.html]*)$ view_details.php 

i assuming want redirect view_details.php each time urls listed accesed. no matter if .html present or not.


Comments