htacces 如果不是索引或管理员


htacces if else index or admin

我有以下htacces。

是否可以在 htacces 中执行 if/elseif。

例:如果 http://url.nl/rs/其他如果 http://url.nl/rs/admin/

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index'.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . rs/index.php [L]
RewriteRule . rs/admin/index.php [L]

是的,有可能:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index'.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^url'.nl/rs$ [NC]
RewriteRule . rs/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^url'.nl/rs/admin$ [NC]
RewriteRule . rs/admin/index.php [L]