Madan Sapkota Madan Sapkota - 1 year ago 72
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?

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

OR you can hide url query

RewriteRule ^search.php?id=(.*)$ /search.php [L,R=301]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download