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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -