Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache URL重写已停止工作_Apache_Mod Rewrite_Url Rewriting_Url Redirection - Fatal编程技术网

Apache URL重写已停止工作

Apache URL重写已停止工作,apache,mod-rewrite,url-rewriting,url-redirection,Apache,Mod Rewrite,Url Rewriting,Url Redirection,对于这个网站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/

对于这个网站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>
Options+FollowSymlinks
重新启动发动机
重写规则^artikels/([0-9]+)/(.*).dhtmlhttp://www.demoeial.be/articles.php?article_id=$1[NC]
重写规则^prints/([0-9]+)/(.*).dhtmlhttp://www.demoeial.be/print.php?action=view&print_id=$1[NC]
重写规则^auteur/([0-9]+)/([0-9]+)/(.*).dhtmlhttp://www.demoeial.be/author.php?action=view&author_id=$1&page=$2[NC]
重写规则^nieuws/([0-9]+)/$category.php?cat_id=1&page=1
重写规则^dossiers/([0-9]+)/(.*)/([0-9]+)/$dossiers.php?dossier_id=$1和page=$3
重写规则^访谈/([0-9]+)/$category.php?cat_id=4&page=1
重写规则^reportages/([0-9]+)/$category.php?cat_id=5&page=1
重写规则^cultuur/([0-9]+)/$category.php?cat_id=6&page=1
重写规则^opinie/([0-9]+)/$category.php?cat_id=2&page=1
重写规则^satire/([0-9]+)/$category.php?cat_id=7&page=1
重写规则^politiek filosofie/([0-9]+)/$category.php?cat_id=8&page=1
重写规则^literair/([0-9]+)/$category.php?cat_id=9&page=1
重写规则^muziek/([0-9]+)/$category.php?cat_id=10&page=1
重写规则^meewerken/$content.php?content_id=2
重写规则^over/$content.php?content\u id=1
重写规则^zoeken/(.*)/([0-9]+)/$search.php?search_words=$1和page=$2
重写规则^print/([0-9]+)/$print.php?页面=$1
AddOutputFilterByType DEFLATE text/css text/javascript应用程序/x-javascript应用程序/javascript文本/x-component文本/html文本/richtext图像/svg+xml文本/纯文本/xsd文本/xsl文本/xml图像/x-icon应用程序/json
它以前是工作的,但从一段时间以来,浏览器显然被重定向到服务器链接。例如,去。在此之前,它从未显示第二个链接,并不断显示好看的一个。我不知道发生了什么,也不知道发生了什么变化,但它以前是有效的。猜猜看

提前谢谢。

我怀疑它以前是否有效。替换URL中以http://开头的规则将创建重定向。更改此规则:

RewriteRule ^artikels/([0-9]+)/(.*).dhtml http://www.demoeial.be/articles.php?article_id=$1 [NC]
为此:

RewriteRule ^artikels/([0-9]+)/(.*).dhtml articles.php?article_id=$1 [NC]

使用这里的conf,没有理由发生重定向。我猜想它是由
.htaccess
@cheese中以前的规则触发的。问题是,htaccess中没有其他规则。我开始认为某些服务器设置或某些东西发生了变化。如果是您的完整
.htaccess
,那么问题来自其他地方。当任何与Apache相关的配置文件被修改时?@cheesemacfly我用完整的.htaccess文件编辑了上面的文章。我正在考虑更改任何配置文件,但想不出任何更改。我刚刚检查了根etc文件夹中的php.ini,但似乎没有发现任何异常。我还检查了同一服务器上的不同站点。我在那里使用了几乎相同的htaccess,所以如果这个htcaccess没有什么问题,那么它肯定与服务器相关?谢谢,就是这样。这是一个简单的解决方案。几天来一直在寻找解决方案!显然,在这过程中,我一定改变了重写url。嗯,这不完全是真的。如果规则以http://开头,然后与当前主机匹配,则不会创建重定向。()