How to show the folder name as subdomain using mod_rewrite without actual redirecting
I want开发者_如何学编程 to display the folder name with a default php file name as subdomain without acutally redirecting to the url using .htaccess file. For Ex: If the actual path is http://test.com/view/login.php it must be shown as login.test.com And if the path is http://test.com/view/container.php it must be shown as view.test.com
Please help me.
Thanks in advance.
Try this configuration:
RewriteCond %{HTTP_HOST} ^(.+)\.example\.org$ [NC]
RewriteRule ^(.*)$ %1/$1 [L,QSA]
精彩评论