Форум у меня лежит в папке /forum
Сделал так
Код: Выделить всё
php_value register_globals 0
# BEGIN OGFF
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^safe\-entrance\.php$ wp-login.php [NC,L]
RewriteCond %{THE_REQUEST} wp\-login\.php [NC]
RewriteRule ^wp\-login\.php$ - [F]
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^/?author=([0-9]*)
RewriteRule ^(.*)$ - [F]
</IfModule>
# END OGFF
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^ublaze\.ru$ [NC]
# RewriteRule ^(.*)$ http://ublaze.ru/$1 [QSA,L,R=301]
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC]
RewriteRule ^([^/]+) $1 [L]
# 301 REDIRECTS
RewriteCond %{THE_REQUEST} /ftopic([^d]+)\.html\ HTTP/
RewriteRule (.*) /forum/topic%1.html? [R=301,L]
# RewriteCond %{HTTP_HOST} ^iblaze\.ru
# RewriteRule ^(.*)$ http://ublaze.ru/$1 [R=301,L]
# RewriteCond %{HTTP_HOST} ^www.iblaze\.ru
# RewriteRule ^(.*)$ http://ublaze.ru/$1 [R=301,L]
#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX
RewriteRule ^forum/forum\.html$ /forum/index.php [QSA,L,R=301]
# FORUM ALL MODES
RewriteRule ^forum/(forum|[a-z0-9_-]*-f)([0-9]+)/?(page([0-9]+)\.html)?$ /forum/viewforum.php?f=$2&start=$4 [QSA,L,R=301]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^forum/(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forum/viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,R=301]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^forum/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forum/viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,R=301]
# PROFILES ALL MODES WITH ID
RewriteRule ^forum/(member|[a-z0-9_-]*-u)([0-9]+)\.html$ /forum/memberlist.php?mode=viewprofile&u=$2 [QSA,L,R=301]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^forum/(member|[a-z0-9_-]*-u)([0-9]+)-(topics|posts)(-([0-9]+))?\.html$ /forum/search.php?author_id=$2&sr=$3&start=$5 [QSA,L,R=301]
# GROUPS ALL MODES
RewriteRule ^forum/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /forum/memberlist.php?mode=group&g=$2&start=$4 [QSA,L,R=301]
# POST
RewriteRule ^forum/post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L,R=301]
# ACTIVE TOPICS
RewriteRule ^forum/active-topics(-([0-9]+))?\.html$ /forum/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,R=301]
# UNANSWERED TOPICS
RewriteRule ^forum/unanswered(-([0-9]+))?\.html$ /forum/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,R=301]
# NEW POSTS
RewriteRule ^forum/newposts(-([0-9]+))?\.html$ /forum/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,R=301]
# UNREAD POSTS
RewriteRule ^forum/unreadposts(-([0-9]+))?\.html$ /forum/search.php?search_id=unreadposts&start=$2 [QSA,L,R=301]
# THE TEAM
RewriteRule ^forum/the-team\.html$ /forum/memberlist.php?mode=leaders [QSA,L,R=301]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES
# Indexing images of the search engine Yandex.ru
RewriteRule ^thumb/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1&t=1 [NC]
RewriteRule ^pic/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1&mode=view [NC]
RewriteRule ^small/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1 [NC]
RewriteRule ^img/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1 [NC]
# WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#####################################################
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
на ссылки типа
Код: Выделить всё
http://сайт.ru/forum/topic1469.html
http://сайт.ru/forum/topic1469-10.html
http://сайт.ru/forum/topic1469-50.html
http://сайт.ru/forum/topic1469-60.html
http://сайт.ru/forum/topic1258-70.html#p15816
не преобразуются в дефлотные ссылки.
Сделал по совету
Anvar см. здесь
Чтобы отказать от SEO ссылок вида
Код: Выделить всё
http://сайт.ru/forum/topic1469.html
http://сайт.ru/forum/topic1469-10.html
http://сайт.ru/forum/topic1469-50.html
http://сайт.ru/forum/topic1469-60.html
в пользу дефлотных, но ничего из этого у меня не вышло.
При переходе по ссылке
http://сайт.ru/forum/topic1189.html получаю такое сообщение
Информация
No route found for "GET /topic1189.html"
содержимое моего .htaccess
Код: Выделить всё
php_value register_globals 0
# BEGIN OGFF
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^safe\-entrance\.php$ wp-login.php [NC,L]
RewriteCond %{THE_REQUEST} wp\-login\.php [NC]
RewriteRule ^wp\-login\.php$ - [F]
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^/?author=([0-9]*)
RewriteRule ^(.*)$ - [F]
</IfModule>
# END OGFF
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^ublaze\.ru$ [NC]
# RewriteRule ^(.*)$ http://ublaze.ru/$1 [QSA,L,R=301]
RewriteCond %{REQUEST_FILENAME} robots.txt$ [NC]
RewriteRule ^([^/]+) $1 [L]
# 301 REDIRECTS
RewriteCond %{THE_REQUEST} /ftopic([^d]+)\.html\ HTTP/
RewriteRule (.*) /forum/topic%1.html? [R=301,L]
RewriteCond %{HTTP_HOST} ^iblaze\.ru
RewriteRule ^(.*)$ http://ublaze.ru/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.iblaze\.ru
RewriteRule ^(.*)$ http://ublaze.ru/$1 [R=301,L]
# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX BACK TO OLD LINKS FOR PHPBB3
RewriteRule ^forum\.html$ /forum/index.php [QSA,L,R=301]
# FORUM ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /forum/viewforum.php?f=$2&start=$4 [QSA,L,R=301]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forum/viewtopic.php?t=$4&start=$6 [QSA,L,R=301]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /forum/viewtopic.php?t=$3&start=$5 [QSA,L,R=301]
# PROFILES THROUGH USERNAME
RewriteRule ^member/([^/]+)/?$ /forum/memberlist.php?mode=viewprofile&un=$1 [QSA,L,R=301]
# USER MESSAGES THROUGH USERNAME
RewriteRule ^member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /forum/search.php?author=$1&sr=$2&start=$4 [QSA,L,R=301]
# GROUPS ALL MODES
RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /forum/memberlist.php?mode=group&g=$2&start=$4 [QSA,L,R=301]
# POST
RewriteRule ^post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L,R=301]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /forum/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,R=301]
# UNREAD POSTS
RewriteRule ^unreadposts(-([0-9]+))?\.html$ /forum/search.php?search_id=unreadposts&start=$2 [QSA,L,R=301]
# THE TEAM
RewriteRule ^the-team\.html$ /forum/memberlist.php?mode=team [QSA,L,R=301]
# Indexing images of the search engine Yandex.ru
RewriteRule ^thumb/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1&t=1 [NC]
RewriteRule ^pic/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1&mode=view [NC]
RewriteRule ^small/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1 [NC]
RewriteRule ^img/.*_(\d+)\.(gif|jpg|jpeg|bmp|png|tiff|tif|tga)$ forum/download/file.php?id=$1 [NC]
# WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#####################################################
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Подскажите как исправить?