【发布时间】:2022-01-14 23:26:07
【问题描述】:
我的主要网址:
localhost/mypage/
我的产品网址:
localhost/mypage/single?slug=UJjd94374
我当前的 htaccess 代码:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
我希望我的产品 URL 更改为:
localhost/mypage/single/UJjd94374
每次我尝试编写它时,我都会收到 500 个服务器错误,有人可以帮助我了解如何让我的 url seo 友好地使用斜杠而不是 slug= 来设置参数
日志:
[Fri Dec 10 16:26:13.919346 2021] [core:error] [pid 22508:tid 1892] [client 127.0.0.1:51785] 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.
【问题讨论】:
-
首先检查错误日志中关于 500 错误的原因。
标签: apache .htaccess url-rewriting