apache - how to remove query string from subdomain using htaccess? -


i have domain (example.com) created subdomain domain (sub.example). have php file in 'dir' folder in subdomain director. need change url

http://sub.example.com/dir/view.php?id=10 

to

http://sub.example.com/dir/view.php/id/10 

i how this? place .htaccess file?

i beginer htaccess please me.

rewriteengine on rewritecond %{http_host} ^sub.example.com$ [nc] 

in root .htaccess can have rule:

rewriteengine on  rewritecond %{http_host} ^sub\.example\.com$ [nc] rewriterule ^(\w+)/(.+?\.php)/(\w+)/(\w+)/?$ $1/$2?$3=$4 [l,nc,qsa] 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -