【发布时间】:2019-04-16 10:59:04
【问题描述】:
我需要它来处理所有 html URL(索引除外),我尝试使用 .htaccess 没有运气。
例如...将此链接从:http://www.example.com/signup.html 更改为 http://www.example.com/?c=signup。
另外,如果我直接输入http://www.example.com/?c=signup,它必须镜像http://www.example.com/signup.html。
编辑 我找到了这样做的方法,除了我直接输入.html文件的情况,在那种情况下,它不会重写。
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{QUERY_STRING} ^c=([^&]+) [NC]
RewriteRule ^/?$ %1.html [NC,L,QSA]
【问题讨论】:
标签: apache .htaccess url mod-rewrite hyperlink