so my url is currently:
I’m wanting to have it accessible as:
Now I’ve also implemented rewrites for .php files as below
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
I’m a little confused now because the search.php is being rewritten to just search but is still accessable with search.php, so when I create my rewrite rule do I rewrite search.php or just search?.. either way I’ve tried and failed to accomplish it lol.
What should I add to have my desired url? Help is much appreciated 🙂
It’s impossible to change parameter name with mod_rewrite. The easiest way to achieve what you want is to add these lines to .htaccess:
and modify search.php to react to
sget parameter the same as it reacts tokeyword.An alternative is to keep .htaccess intact and add these at the top of index.php: