Click here to Skip to main content
15,894,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to change the URL of a search page.
For Example, if someone searches on my website then the URL is
https://myweb.com/search.php?search=searched-keyword
I want to change it to something like
https://myweb.com/search/searched-keyword

How do I do this using PHP or .htaccess file

What I have tried:

I have used it in my .htaccess but it didn't work for me...
RewriteEngine On
    RewriteRule ^search.php?search=(.*)$ https://myweb.com/search$1 [L,R=301]
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900