snew
snew

Reputation: 101

dynamic sub domains

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} ([^.]+)\.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.

Upvotes: 1

Views: 98

Answers (1)

Franz
Franz

Reputation: 11553

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

Upvotes: 1

Related Questions