开发者

dynamic sub domains

开发者 https://www.devze.com 2022-12-14 10:55 出处:网络
I want to show user\'s mini-website on the server by creating dynamic subdomains. The re-write rule is written as below:

I want to show user's mini-website on the server by creating dynamic subdomains.

The re-write rule is written as below:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yourwebsite.com
RewriteCond %{HTTP_HOST开发者_Go百科} ([^.]+)\.yourwebsite.com
RewriteRule ^(.*)$ /path_to_your_site/public_html/app/test/home.php?url=%1

In the home.php page the web.css file is included as shown below:

But the CSS is not getting applied on home.php page due to css file path problem.


I would suggest using another subdomain for those files, for example static.yourwebsite.com. If I am not mistaken, you would then have to add this line to your .htaccess file:

RewriteCond %{HTTP_HOST} !^static\.yourwebsite.com
0

精彩评论

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