【发布时间】:2018-02-05 15:53:58
【问题描述】:
在 google、stackoverflow、youtube 上尝试了许多不同的变体,但仍然不适合我。
我尝试在 .htaccess 中使用的示例之一:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^index/([0-9]+)$ index.php?lang=$1 [L]
我的网址: http://mydmain.com/subfolder/?lang=en
我希望这个网址看起来像: http://mydmain.com/subfolder/en
【问题讨论】:
-
所以您在浏览器中输入了mydmain.com/subfolder/en,但没有任何反应?
-
是的。我得到 404 未找到。
-
您现有的规则将
example.com/index/123重写为/index.php?lang=123这不是您想要的吗? -
我尝试使用 url mydmain.com/subfolder/en 和 mydmain.com/subfolder/index/en 访问内容,但它们不起作用。
标签: .htaccess url url-rewriting