mod_rewrite

-faqer-

Я только учусь
mod_rewrite

Прописал себе в хтаецесе
PHP:
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^robots.txt$ /spiders.php?ip=%{REMOTE_ADDR}&host=%{REMOTE_HOST}&ua=%{HTTP_USER_AGENT}
RewriteRule ^c/$ /c.php?action=copyright
RewriteRule ^c/([a-z0-9])+/$ /c.php?action=$1
RewriteRule ^c/([a-z0-9])+/([a-z0-9_]+)/$ /c.php?action=$1&page=$2
Работает, но чувствительно к последнему слэшу
Что сделать лучше??
Написать по два рула
PHP:
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^robots.txt$ /spiders.php?ip=%{REMOTE_ADDR}&host=%{REMOTE_HOST}&ua=%{HTTP_USER_AGENT}
RewriteRule ^c/$ /c.php?action=copyright
RewriteRule ^c$ /c.php?action=copyright
RewriteRule ^c/([a-z0-9])+/$ /c.php?action=$1
RewriteRule ^c/([a-z0-9])+$ /c.php?action=$1
RewriteRule ^c/([a-z0-9])+/([a-z0-9_]+)/$ /c.php?action=$1&page=$2
RewriteRule ^c/([a-z0-9])+/([a-z0-9_]+)$ /c.php?action=$1&page=$2
Или последний слэш в скобки всунуть
PHP:
RewriteEngine on
Options +FollowSymlinks
RewriteRule ^robots.txt$ /spiders.php?ip=%{REMOTE_ADDR}&host=%{REMOTE_HOST}&ua=%{HTTP_USER_AGENT}
RewriteRule ^c(/)?$ /c.php?action=copyright
RewriteRule ^c/([a-z0-9])+(/)?$ /c.php?action=$1
RewriteRule ^c/([a-z0-9])+/([a-z0-9_]+)(/)?$ /c.php?action=$1&page=$2
 
Сверху