Multiple RewriteRule for one RewriteCond

From the side I have about 400,000 subdomains. in view of the foregoing, some calls also support the subdomain level, for example.

subdomain1.example.com/some_action/ 

Such actions, which should be performed only from the region, have 27.

Htaccess file I created a rule:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?example.com
RewriteRule ^some_action1/?$ index.php?some_action1 [L] 

If I add this line

RewriteRule ^some_action2/?$ index.php?some_action2 [L]

do not work the same as for some_action3, etc.

I added for each action separately

RewriteCond %{HTTP_HOST} ^(www.)?example.com

Can you somehow move to harmonization?

+4
source share
1 answer

RewriteCond RewriteRule. , , . - , . , , :

RewriteEngine On

RewriteCond %{HTTP_HOST} !^(www.)?example.com
RewriteRule ^ - [L]

RewriteRule ^some_action1/?$ index.php?some_action1 [L] 
RewriteRule ^some_action2/?$ index.php?some_action2 [L] 
RewriteRule ^some_action3/?$ index.php?some_action3 [L] 

etc...

, example.com . , .

, "some_action" GET, :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?example.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php?$1 [L] 
+3

All Articles