.htaccess - Giving parameters to php with RewriteRule -


i need rewriterule call php file parameters specified in url entred

ex : if url entered http://www.example.com/folder1/sub1

to make call go.php?p1=folder1&p2=sub1

try using

rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (.*)?/(.*) /go.php?p1=$1&p2=$2 

where rewritecond %{request_filename} !-f,!-d tell mod_rewrite apply rule paths not mapped existing files , directories.

see official documentation.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -