Reputation: 33
For url like: http://sub.domain.com rule from third line should apply. It worked before but on new server it doesn't.
Rules from last two lines for url like: http://sub.domain.com/test works fine.
RewriteCond %{HTTP_HOST} ^(.+?)\.domain\.com$ [NC]
RewriteCond %{REQUEST_URI} !^(.*\..*)$
RewriteRule ^/?$ site/index.php?site=%1 [L,QSA]
RewriteCond %{HTTP_HOST} ^(.+?)\.domain\.com$ [NC]
RewriteRule ^([^.]+)/?$ site/index.php?site=%1&page=$1 [L,QSA]
Thank you in advance for any help.
Upvotes: 0
Views: 20
Reputation: 143886
Try changing to:
RewriteCond %{HTTP_HOST} ^(.+?)\.domain\.com$ [NC]
RewriteRule ^(?:index\.php|)$ site/index.php?site=%1 [L,QSA]
RewriteCond %{HTTP_HOST} ^(.+?)\.domain\.com$ [NC]
RewriteRule ^([^.]+)/?$ site/index.php?site=%1&page=$1 [L,QSA]
Upvotes: 1