Saturday 15 May 2010

php - htaccess rewrite rule without changing URL -



php - htaccess rewrite rule without changing URL -

i have code in htaccess file:

options +followsymlinks -multiviews rewriteengine on rewritebase / #rewritecond %{request_filename} !-f #rewritecond %{request_filename} !-d rewriterule ^([a-za-z0-9-/_]+)/?$ http://subdomain.example.com/index.php?id=$1 [l,qsa]

but everytime go http://subdomain.example.com/test/test

it should resolve to:

http://subdomain.example.com/index.php?id=test/test

which does, changing url above , not keeping original url

remove http:// target url:

options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{http_host} =subdomain.example.com rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.+)$ index.php?id=$1 [l,qsa]

i have corrected regex in rewriterule.

php apache .htaccess mod-rewrite redirect

No comments:

Post a Comment