[英]htaccess RewriteRule isn't working as expected
I'm making a blog like website in PHP. 我正在用PHP创建类似网站的博客。 So I have to rewrite my URLs. 因此,我必须重写我的URL。 I have two urls like: 我有两个网址,例如:
/post.php?name=something&slug=somethingElse /post.php?name=something&slug=somethingElse
And 和
/tutorial.php?name=something /tutorial.php?name=something
So I want to rewrite it like 所以我想像这样重写它
/post/something/somethingElse /岗位/事/ somethingElse
And for the second one 第二个
/tutorial/something /教程/某事
So I'm using following lines in .htaccess : 所以我在.htaccess中使用以下行:
RewriteEngine on
RewriteRule ^(.+)/(.+)[/]?([.+]?)$ $1.php?name=$2&slug=$3
But it isn't working as I expect to.. Tried Google and Stack answers but that didn't help. 但是它没有按我预期的那样工作。尝试过Google和Stack的答案,但这没有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.