【问题标题】:Loop trying to access php pages循环尝试访问 php 页面
【发布时间】:2016-02-25 22:54:46
【问题描述】:

我正在为我试验一个未知的问题。在 www.graficaslapaz.com 中,当我选择指向其他页面的任何链接时,资源管理器会引发错误。

查看我的日志文件显示:

[Thu Feb 25 08:58:42.601721 2016] [core:error] [pid 163316:tid 140473331054336] [client 178.7.107.86:57067]
AH00124: 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: http://www.graficaslapaz.com/instalaciones.php
[Thu Feb 25 08:58:42.601758 2016] [core:error] [pid 163316:tid 140473331054336] [client 178.7.107.86:57067]
AH00124: 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: http://www.graficaslapaz.com/instalaciones.php

这是我的 .htaccess 的内容

RewriteEngine on
Options -Indexes

RewriteRule ^home home.php
RewriteRule ^empresa empresa.php
RewriteRule ^instalaciones instalaciones.php
RewriteRule ^acceso_clientes acceso_clientes.php

RewriteRule ^nuevo_cliente nuevo_cliente.php
RewriteRule ^enviar_cliente enviar_cliente.php

RewriteRule ^presupuestos presupuestos.php
RewriteRule ^enviar_presupuesto enviar_presupuesto.php

RewriteRule ^subir_archivo subir_archivo.php
RewriteRule ^enviar_archivo enviar_archivo.php

RewriteRule ^suscribete suscribete.php
RewriteRule ^enviar_suscripcion enviar_suscripcion.php

RewriteRule ^trabajos/([0-9]+) trabajos.php?id=$1
RewriteRule ^trabajos trabajos.php

RewriteRule ^hp-indigo-digital hp-indigo-digital.php
RewriteRule ^packaging_plus packaging_plus.php

RewriteRule ^equipo_humano equipo_humano.php
RewriteRule ^seccion_empresa/(.*) seccion_empresa.php?seccion=$1

RewriteRule ^oferta oferta.php
RewriteRule ^enviar_oferta enviar_oferta.php

RewriteRule ^contacto contacto.php
RewriteRule ^privacidad privacidad.php
RewriteEngine on

我不知道导致此循环的根源在哪里以及如何解决它。

你能帮帮我吗?

【问题讨论】:

    标签: loops mod-rewrite url-rewriting


    【解决方案1】:

    你有模式^home。现在,此模式将匹配以下所有内容(及其派生词):

    home
    home1
    homexzs
    home.php
    

    如您所见,该模式将匹配 home.php 并将 URL 重写为再次匹配该模式的 home.php,从而导致无限重写(或内部重定向)。

    使用$ 锚点进行完全匹配:

    RewriteEngine On
    RewriteRule ^(home|empresa|instalaciones|acceso_clientes|nuevo_cliente|enviar_cliente|presupuestos|enviar_presupuesto|subir_archivo|enviar_archivo|suscribete|enviar_suscripcion|trabajos|hp-indigo-digital|packaging_plus|equipo_humano|oferta|enviar_oferta|contacto|privacidad)$ $1.php [L]
    
    RewriteRule ^trabajos/([0-9]+) trabajos.php?id=$1 [L]
    RewriteRule ^seccion_empresa/(.*) seccion_empresa.php?seccion=$1 [L]
    

    【讨论】:

    • @DavidSusí 将回复标记为答案。
    猜你喜欢
    • 1970-01-01
    • 2015-02-05
    • 2021-06-08
    • 2016-08-28
    • 2013-05-20
    • 2010-10-17
    • 1970-01-01
    • 1970-01-01
    • 2015-01-07
    相关资源
    最近更新 更多