我希望访问者输入 http://localhost/mywebsite/paris/
它调用 http://localhost/mywebsite/page.php?city=paris
但是当输入 http://localhost/mywebsite/
它调用 http://localhost/mywebsite/index.php
RewriteEngine On
RewriteRule ([a-zA-Z-]*) /page.php?city=$1 [QSA,L]
我收到以下错误:
Not Found
The requested URL was not found on this server.
最佳答案
RewriteRule ^([a-zA-Z0-9]+)$ page.php?city=$1
RewriteRule ^([a-zA-Z0-9]+)/$ page.php?city=$1
https://stackoverflow.com/questions/64422226/
相关文章:
reactjs - 我怎么能告诉 typescript Prop 来自 react 克隆元素?
android - 如何从 Android 应用程序内部了解用户谷歌播放国家/地区?
javascript - 使用 React 根据另一个下拉列表更新选择的选项
python - 使用 python 控制包的错误奈奎斯特图
json - Angular environment.ts 问题 JSON。然而 environme
MongoDB Atlas 搜索 - 搜索字符串中的多个术语具有 'and' 条件(不是 'or'