对于这个网站 www.demoeial.be,我对每个链接都使用了 URL 重写。这是文章的重写规则:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^artikels/([0-9]+)/(.*).dhtml http://www.demoeial.be/articles.php?article_id=$1 [NC]
RewriteRule ^prints/([0-9]+)/(.*).dhtml http://www.demoeial.be/print.php?action=view&print_id=$1 [NC]
RewriteRule ^auteur/([0-9]+)/([0-9]+)/(.*).dhtml http://www.demoeial.be/author.php?action=view&author_id=$1&page=$2 [NC]
RewriteRule ^nieuws/([0-9]+)/$ category.php?cat_id=1&page=$1
RewriteRule ^dossiers/([0-9]+)/(.*)/([0-9]+)/$ dossiers.php?dossier_id=$1&page=$3
RewriteRule ^interviews/([0-9]+)/$ category.php?cat_id=4&page=$1
RewriteRule ^reportages/([0-9]+)/$ category.php?cat_id=5&page=$1
RewriteRule ^cultuur/([0-9]+)/$ category.php?cat_id=6&page=$1
RewriteRule ^opinie/([0-9]+)/$ category.php?cat_id=2&page=$1
RewriteRule ^satire/([0-9]+)/$ category.php?cat_id=7&page=$1
RewriteRule ^politiek-filosofie/([0-9]+)/$ category.php?cat_id=8&page=$1
RewriteRule ^literair/([0-9]+)/$ category.php?cat_id=9&page=$1
RewriteRule ^muziek/([0-9]+)/$ category.php?cat_id=10&page=$1
RewriteRule ^meewerken/$ content.php?content_id=2
RewriteRule ^over/$ content.php?content_id=1
RewriteRule ^zoeken/(.*)/([0-9]+)/$ search.php?search_words=$1&page=$2
RewriteRule ^print/([0-9]+)/$ print.php?page=$1
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript application/javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
</IfModule>
它以前可以工作,但由于一段时间以来浏览器显然被重定向到服务器链接。例如http://www.demoeial.be/artikels/10436/Studentenoverleg-VGC-levert-weinig-op.dhtml转到http://www.demoeial.be/articles.php?article_id=10436。在它从未显示第二个链接之前,一直显示好看的链接。我不知道发生了什么或改变了什么,但它以前工作过。有什么猜测吗?
提前致谢。