Click here to Skip to main content
13,804,051 members
Rate this:
 
Please Sign up or sign in to vote.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.181218.1 | Last Updated 8 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100