内部服务器错误与RewriteRule

编程入门 行业动态 更新时间:2024-10-28 16:23:22
本文介绍了内部服务器错误与RewriteRule的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个问题是,何时更改我的网站的网址,该网址是动态生成的.

I have a problem is when change the url of my site, which is generated dynamically.

我启用了Apache模块mod rewrite localhost wamp服务器.完美地在Fundionaba之前,但是在php url之前使用两个变量现在删除一台服务器失败.我不明白为什么会失败.你能帮我吗?

I have the Apache module mod rewrite localhost wamp server enabled. Before fundionaba perfectly, but before the php url used two variables now to remove one server fails. I do not understand why fails. Can you help me?

当您单击这些以前有效的链接时,服务器错误很奇怪.如果php变量或php错误出了问题,因为这可能会,但服务器却没有.

It is very strange that server error when you click on these same links that worked previously. If there is a problem with the php variable or php error because it would, but not a server error.

htaccess正常运行之前的规则:

htaccess rules before when it worked perfectly:

RewriteRule ^nov/([^/]*)/([^/]*)\.php$ /nov/nov.php?url=$1&url=$2 [L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /nov/nov\.php\?url=(.+)&url=(.+)\ HTTP/ RewriteRule ^nov/nov\.php$ /nov/%1/%2\.php? [L,R=301]

我现在通过删除一个不会产生内部服务器错误的变量来使用的规则:

Rules that I used now by removing one variable that WORKS NOT giving the Internal server error:

RewriteRule ^nov/([^/]*)\.php$ /nov/nov.php?url=$1 [L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /nov/nov\.php\?url=(.+)\ HTTP/ RewriteRule ^nov/nov\.php$ /nov/%1\.php? [L,R=301]

让我们看看我是否可以说出错误的原因,我所做的就是删除其中一个变量.谢谢.

Let's see if I can say the reason for the error, all I've done is remove one of the variables. Thank you.

Apache服务器错误日志:

Apache Server error log:

[Thu Mar 03 10:17:46 2016] [error] [client ::1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: localhost/

推荐答案

您必须排除要重写的目标,否则将收到无限循环错误,因为/nov/nov.php?url=$1 也匹配 ^ nov/(.+).php $

You have to exclude the destination you are rewriting to othewise you will get an infinite loop error because /nov/nov.php?url=$1 also matches the pattern ^nov/(.+).php$

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /nov/nov\.php\?url=([^\s]+) [NC] RewriteRule ^ /nov/%1.php? [L,R=301] RewriteCond %{REQUEST_URI} !^/nov/nov\.php RewriteRule ^nov/(.+)\.php$ /nov/nov.php?url=$1 [L]

更多推荐

内部服务器错误与RewriteRule

本文发布于:2023-11-01 23:46:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550749.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   服务器   RewriteRule

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!