.htaccess - htaccess redirect - subdomain with query ignored - subdomain only redirect to php -



.htaccess - htaccess redirect - subdomain with query ignored - subdomain only redirect to php -

i want allow sudomains containing queries or requests ignored:

e.g. http://sub.domain.com/documents or http://sub.domain.com/index.php?user=fred

but if uri subdomain

e.g. http://sub.domain.com

if gets redirected

http://sub.domain.com/portal.php

how do using htaccess file ?

put code in document_root/.htaccess file:

rewriteengine on rewritecond %{query_string} ^$ rewritecond %{http_host} ^sub\.domain\.com$ [nc] rewriterule ^/?$ /portal.php [l]

php .htaccess mod-rewrite redirect

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -