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
Post a Comment