Опять у меня та же проблема, господа программисты, подскажите, пожалуйста. Нужен перенаправить пару страниц, например старый адрес сайт.ru/nash-klub.html на новый адрес сайт.ru/nash-klub/
Пробую прописать как выше RewriteRule ^/nash-klub.html$ /nash-klub/ [R=301,L] но что-то не работает. Как сделать такое перенаправление?
Файл .htaccess
AddDefaultCharset utf-8
<Files ".htaccess">
deny from all
</Files>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
ErrorDocument 404 /404.html
RewriteRule ^/nash-klub.html$ /nash-klub/ [R=301,L]
#
RewriteRule ^index.html$ /$1 [L,R=301]
# admin
RewriteRule ^admin/$ admin/index.php
RewriteRule ^admin.html$ admin/index.php
RewriteRule ^admin$ admin/index.php
# captcha
RewriteRule ^captcha.php$ mycode/captcha.php
# photo
RewriteRule ^photo-cat-([-a-zA-Z0-9_]*)?-([0-9]*)?.html$ index.php?whatpage=photo&cat=$1&page=$2
RewriteRule ^photo-cat-([-a-zA-Z0-9_]*).html? index.php?whatpage=photo&cat=$1
RewriteRule ^photo-([0-9]*).html? index.php?whatpage=photo&page=$1
# news
RewriteRule ^news/index.php$ /news/ [QSA,R]
RewriteRule ^news/$ index.php?whatpage=news
RewriteRule ^news.html$ /news/ [QSA,R]
RewriteRule ^news/page([0-9]*)?.html$ index.php?whatpage=news&newspage=$1
RewriteRule ^news/([-a-zA-Z0-9_]*)/?index.php$ /news/$1/ [QSA,R]
RewriteRule ^news/([-a-zA-Z0-9_]*)/?page([0-9]*)?.html$ index.php?whatpage=news&catnews=$1&newspage=$2
RewriteRule ^news/([-a-zA-Z0-9_]*)?.html$ index.php?whatpage=news&view=$1
RewriteRule ^news/([-a-zA-Z0-9_]*)/?$ index.php?whatpage=news&catnews=$1
RewriteRule ^news/([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ index.php?whatpage=news&catnews=$1&view=$2
# guestbook
RewriteRule ^guestbook-start-([0-9]*).html?$ index.php?whatpage=guestbook&start=$1
RewriteRule ^guestbook-post-([0-9]*).html?$ index.php?whatpage=guestbook&id=$1
# pages
RewriteRule ^([-a-zA-Z0-9_]*)?.html$ index.php?whatpage=$1
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)/?spage-([0-9]*)?.html$ index.php?catpage=$1&subcatpage=$2&spage=$3
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ index.php?catpage=$1&whatpage=$2
RewriteRule ^([-a-zA-Z0-9_]*)/?$ index.php?catpage=$1
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)?.html$ index.php?catpage=$1&subcatpage=$2&whatpage=$3
RewriteRule ^([-a-zA-Z0-9_]*)/?([-a-zA-Z0-9_]*)/?$ index.php?catpage=$1&subcatpage=$2
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 7 days"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/html "access plus 7 day"
ExpiresByType text/x-javascript "access 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/x-shockwave-flash "access 1 year"
</IfModule>
<ifModule mod_headers.c>
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\.(css|js)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</filesMatch>
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=172800, private, must-revalidate"
</filesMatch>
</ifModule>
<IfModule mod_setenvif.c>
BrowserMatch "MSIE" force-no-vary
BrowserMatch "Mozilla/4.[0-9]{2}" force-no-vary
</IfModule>