我需要你的幫助。刪除擴展程序後重寫url
我不得不重寫擴展刪除後的動態URL的問題,我已經重寫這個URL,但沒有作品:
的.htaccess這樣的:
<IfModule mod_rewrite.c>
Options -Multiviews
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
#add www 1
RewriteCond %{HTTP_HOST} !^www\.mondomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.mondoamin.com/$1 [R=301,L]
#remove .php extension 2
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
# Removes index.php from ExpressionEngine URLs 3
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ /index.php/$1 [L]
#rewrite url 4
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /article\.php\?id_ article =([^&\ ]+)([^\ ]*)
RewriteRule ^/article/%1?%2 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([^/]+/)*[^.#?\ ]+\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(([^/]+/)*[^.]+)\.php $1 [R=301,L]
</IfModule>
結果: 1 + 2 + 3工作正常,但4不是工作
在此先感謝
我害怕。它不工作! – Nashen
這個.htaccess的位置和它不工作的URL是什麼? – anubhava
.htaccess位於我的網站的根目錄中。這裏是不起作用的網址:RewriteCond%{THE_REQUEST}^[AZ] {3,9} \ /article\.php\?id_ article =([^&\] +)([^ \] *) RewriteRule ^/article /%1?%2 [L,R = 301] – Nashen