[英]RewriteRule not working for some links in XAMPP apache
RewriteEngine On
RewriteRule ^home/?$ pages/forum_html.php [NC,L]
RewriteRule ^forum-thread/([A-Za-z0-9]+)/?$ pages/forum_thread_gen_html.php?thread_id=$1 [NC,L]
I am trying to do an internal URL redirect. 我正在尝试进行内部URL重定向。 The first RewriteRule works fine but the second doesn't work, the page shows object not found but when I change the second line to
^forum-thread/?$
the page displays but of course no id for my page to process. 第一个RewriteRule工作正常,但第二个不起作用,页面显示找不到对象但是当我将第二行更改为
^forum-thread/?$
页面显示但当然没有我的页面要处理的ID。
Does anyone have any idea what might be happening? 有谁知道可能会发生什么?
The second URL looks like this: 第二个URL如下所示:
localhost/rootfolder/projectfolder/forum-thread/cdjd2_dsdsd4_adsda/
The URL
had underscores and the pattern matching sequence I used did not have an underscore in it. URL
有下划线,我使用的模式匹配序列中没有下划线。 I have edited the second RewriteRule as so: RewriteRule ^forum-thread/([A-Za-z0-9-_]+)/?$ pages/forum_thread_gen_html.php?thread_id=$1 [NC,L]
我已经编辑了第二个RewriteRule:
RewriteRule ^forum-thread/([A-Za-z0-9-_]+)/?$ pages/forum_thread_gen_html.php?thread_id=$1 [NC,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.