I'm trying to redirect this url:www.example.com/path/index.php?user=username&option=optnameto username.example.com/path/optname.htmlI tried several ways but I'm getting errors. How to do that?
HTACCESS change subdomain, add a custom file extension and url parameters
htaccess
Here's the sample rewrite commands you should be looking for:RewriteEngine onRewriteCond %{HTTP_HOST} ^example.com [NC,OR]RewriteCond %{HTTP_HOST} ^www.example.com [NC]RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]