mod_rewrite RewriteRule 的重定向循环错误
我正在尝试 mod_rewrite:
localhost/edit.php?title=?&user_id=?
至:
localhost/edit/<?php echo $title.'/'.$user_id; ?>
循环
echo '<a href="localhost/edit/'.$title.'/'.$user_id.'">'.$title.'</a>';
因此,我可以将链接输出为我正在使用的
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#Reroute through index.php
RewriteRule ^([a-zA-Z0-9_]+) index.php?title=$1 [NC]
#this is RewriteRule for edit.php UPDATED:
RewriteRule ^/?edit/([a-zA-Z0-9_]+)/([0-9]+)$ edit/index.php?title=$1&user_id=$2 [NC,L]
:
但是,我收到此错误:
该网页有重定向循环
I'm trying to mod_rewrite:
localhost/edit.php?title=?&user_id=?
To:
localhost/edit/<?php echo $title.'/'.$user_id; ?>
So, I can output links as a loop
echo '<a href="localhost/edit/'.$title.'/'.$user_id.'">'.$title.'</a>';
I'm using:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#Reroute through index.php
RewriteRule ^([a-zA-Z0-9_]+) index.php?title=$1 [NC]
#this is RewriteRule for edit.php UPDATED:
RewriteRule ^/?edit/([a-zA-Z0-9_]+)/([0-9]+)$ edit/index.php?title=$1&user_id=$2 [NC,L]
However, I get this error:
This webpage has a redirect loop
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个
Try this