我有一个是越来越动态生成列出基于所有网点在我的网站页面cityf
参数及以下重写规则将其转换成搜索引擎友好的URL,它是相当不错的了。
RewriteRule ^([^/.]+)/?$ /cityres?cityf=$1 [L]
我有我的网站的博客页面和的.htaccess是如下转换搜索引擎友好的URL( http://example.com/title-of-blog
)
RewriteRule ^([^/.]+)/?$ /blogdetail?prmn=$1 [L]
现在,这里的问题我面对的是,当有人访问blog
,然后页面中的链接http://example.com/title-of-blog
,而不是在页面上展示博客的细节,显示我的错误信息,即No outlets near title-of-blog
。
我得到了Apache是无法确定时,要重写问题cityres
页面,当重写blogdetail
页。
有人建议, Make sure that each rule has a common prefix (eg /blog/page1 and /news/page2).
但我没有得到这一点。
这里有什么建议吗?
编辑:
整个htaccess的是如下
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php
RewriteRule ^index\.php$ / [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index
RewriteRule ^index\.php$ / [L,R=301]
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
# remove .php from URL
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
# remove .html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/.]+)\.html$ /$1 [L,R=301]
ErrorDocument 404 /error-page
ErrorDocument 403 /error-page
RewriteRule ^food-([^-]*)-([^-]*)\.html$ /pdetail?res_id=$1&location=$2 [L]
RewriteRule ^foodies-([^-]*)-([^-]*)$ /pdetail_new?res_id=$1&location=$2 [L]
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/?$ /pdetail_ne?location=$1&res_id=$2&name=$3 [L]
RewriteRule ^blog/([^/.]+)/?$ /blogdetail_fm?prmn=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !cityres
RewriteRule ^([^/.]+)/?$ /cityres?cityf=$1 [L]