开发者

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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜