Madan Sapkota Madan Sapkota - 8 months ago 13
PHP Question

Apache rewrite query string to CodeIgniter like URL

Here is a sample URL with query string. The

is anything that User Search in my website or redirect from other websites, search engines etc.

and the equivalent CodeIgniter URL (search = controller and now =

How to Rewrite the URLs in Apache .htaccess to create URLs like CodeIgniter?

RewriteRule ^/?search/now/(.*)$ /search\.php?q=$1

OR you can hide url query

RewriteRule ^search.php?id=(.*)$ /search.php [L,R=301]