Новости | Документация | Download | Webboard | FAQ | Поиск | Контакты

Apache.RU - Webboard



Вернуться
Mod_rewrite!!!! (john07) 15/12 - 09:45:52
      Re: Mod_rewrite!!!! (john07) 15/12 - 10:21:23
      Re: Mod_rewrite!!!! (john07) 16/12 - 16:05:06
      Re: Mod_rewrite!!!! (Nogrogomed) 27/01 - 17:06:08

> Original message text:
> From: john07 - 15/12 - 09:45:52
> Subject:Mod_rewrite!!!!
> -----------------
> Проблемка такая...Ниже приведу пример файла .htaccess..URL преобразовывает нормально..т.е. все php файлы меняет на html, в общем все красиво, только теперь в cgi директорию доступ пропал:( Когда обращаюсь к файлу например http://site/cgi-bin/sql.pl В IE пишет "Forbidden
> You don't have permission to access /cgi-bin/sql.pl on this server." В логе "Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: e:/web/oper/cgi-bin/sql.pl".. Помогите если можете...Для меня Mod_rewrite это темный лес:(
>


From: john07 - 15/12 - 10:21:23
Subject:Mod_rewrite!!!!
-----------------
RewriteEngine on

# news page list links pm events plug auth index

RewriteRule ^([a-z]+)\.([a-z]+)$ $1.php [L]
RewriteRule ^index-([a-z]+)-([0-9]+)\.([a-z]+)$ index.php?m=$1&id=$2 [L]
RewriteRule ^index-([a-z]+)\.([a-z]+)$ index.php?c=$1 [L]
RewriteRule ^news-([a-z]+)\.([a-z]+)$ news.php?m=$1 [L]
RewriteRule ^page-([0-9]+)\.([a-z]+)$ page.php?id=$1 [L]
RewriteRule ^list-(.+)\.([a-z]+)$ list.php?c=$1 [L]
RewriteRule ^links-(.+)\.([a-z]+)$ links.php?c=$1 [L]
RewriteRule ^events-([a-z]+)\.([a-z]+)$ events.php?m=$1 [L]
RewriteRule ^pm-([a-z]+)\.([a-z]+)$ pm.php?m=$1 [L]
RewriteRule ^pm-([0-9]+)\.([a-z]+)$ pm.php?id=$1 [L]
RewriteRule ^auth-([a-z]+)\.([a-z]+)$ auth.php?m=$1 [L]
RewriteRule ^admin-([a-z]+)\.([a-z]+)$ admin.php?m=$1 [L]
RewriteRule ^plug-([a-z]+)\.([a-z]+)$ plug.php?p=$1 [L]
RewriteRule ^index-([a-z]+)\.([a-z]+)$ index.php?m=$1 [L]
RewriteRule ^journal-([a-z]+)\.([a-z]+)$ journal.php?m=$1 [L]
RewriteRule ^journal-([0-9]+)\.([a-z]+)$ journal.php?id=$1 [L]
RewriteRule ^rss-([a-z]+)\.([a-z]+)$ rss.php?m=$1 [L]

# filter in pm, events users
RewriteRule ^([a-z]+)-f-([a-zA-Z0-9_]+)\.([a-z]+)$ $1.php?f=$2 [L]

# forums
RewriteRule ^([a-z]+)-([spq])([0-9]+)\.([a-z]+)$ forums.php?m=$1&$2=$3 [L]
RewriteRule ^([a-z]+)-([spq])([0-9]+)-([a-z]+)\.([a-z]+)$ forums.php?m=$1&$2=$3&n=$4 [L]
RewriteRule ^([a-z]+)-([spq])([0-9]+)-([d])([0-9]+)\.([a-z]+)$ forums.php?m=$1&$2=$3&$4=$5 [L]

# users events details and news single details
RewriteRule ^([newsusrvt]+)-([a-z]+)-([0-9]+)\.([a-z]+)$ $1.php?m=$2&id=$3 [L]


#################( this part for folders like urls )#################

Options -Multiviews
RewriteBase /

# news page list links pm events plug auth index

RewriteRule ^([a-z]+)$ $1.php [L]
RewriteRule ^index/([a-z]+)/([0-9]+)/?$ index.php?m=$1&id=$2 [L]
RewriteRule ^index/([a-z]+)$ index.php?c=$1 [L]
RewriteRule ^news/([a-z]+)$ news.php?m=$1 [L]
RewriteRule ^page/([0-9]*)$ page.php?id=$1 [L]
RewriteRule ^list/(.+)$ list.php?c=$1 [L]
RewriteRule ^links/(.+)$ links.php?c=$1 [L]
RewriteRule ^events/([a-z]+)$ events.php?m=$1 [L]
RewriteRule ^pm/([a-z]+)$ pm.php?m=$1 [L]
RewriteRule ^pm/([0-9]+)$ pm.php?id=$1 [L]
RewriteRule ^auth/([a-z]+)$ auth.php?m=$1 [L]
RewriteRule ^admin/([a-z]+)$ admin.php?m=$1 [L]
RewriteRule ^plug/([a-z]+)$ plug.php?p=$1 [L]
RewriteRule ^index/([a-z]+)$ index.php?m=$1 [L]
RewriteRule ^journal/([a-z]+)$ journal.php?m=$1 [L]
RewriteRule ^journal/([0-9]+)$ journal.php?id=$1 [L]
RewriteRule ^rss/([a-z]+)$ rss.php?m=$1 [L]

# filter in pm, events users
RewriteRule ^([a-z]+)/f/([a-zA-Z0-9_]+)$ $1.php?f=$2 [L]

# forums
RewriteRule ^([a-z]+)/([spq])([0-9]+)$ forums.php?m=$1&$2=$3 [L]
RewriteRule ^([a-z]+)/([spq])([0-9]+)/([a-z]+)$ forums.php?m=$1&$2=$3&n=$4 [L]
RewriteRule ^([a-z]+)/([spq])([0-9]+)/([d])([0-9]+)$ forums.php?m=$1&$2=$3&$4=$5 [L]

# users events details and news single details
RewriteRule ^([newsusrvt]+)/([a-z]+)/([0-9]+)$ $1.php?m=$2&id=$3 [L]
RewriteRule ^index/([0-9]+)$ index.php?m=single&id=$1 [L]





[Это сообщение - спам!]

Последние сообщения из форума

 Имя:
 E-mail:
 Тема:
 Текст:
Код подтверждения отправки: Code
18113




  Copyright Apache.ru © 1999-2017, All Rights Reserved Разработка сайта: Inside.ru  
  РЕКЛАМА НА САЙТЕ: |