Apache 将 example.com/forum 重写为 example.com/index.php?page=forum
我是 Apache 重写的完全初学者。
我试图将 example.com/forum 变为 example.com/index.php?page=forum
这是我的重写文件
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/forum$ index.php?page=forum
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Im a complete beginner with Apache re-writes.
Im trying to get example.com/forum to be example.com/index.php?page=forum
Here is my rewrite file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/forum$ index.php?page=forum
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该对你有用。
This should work for you.