Apache .htaccess重定向哪个不';没有来自根的查询字符串和第一级
我想重定向没有/?查询字符串到如下所示的查询字符串 到 只需要一个斜杠级别的重定向,比如:或 不想像这样重定向: 请帮我写这篇文章,我写得不太好Apache .htaccess重定向哪个不';没有来自根的查询字符串和第一级,apache,.htaccess,mod-rewrite,redirect,Apache,.htaccess,Mod Rewrite,Redirect,我想重定向没有/?查询字符串到如下所示的查询字符串 到 只需要一个斜杠级别的重定向,比如:或 不想像这样重定向: 请帮我写这篇文章,我写得不太好 谢谢。您可以在root.htaccess中使用此规则: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^((?!index\.html)[^/]+)/?$ /?id=$1 [L,QSA,NC]
谢谢。您可以在root.htaccess中使用此规则:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?!index\.html)[^/]+)/?$ /?id=$1 [L,QSA,NC]
谢谢你Anubhava:),这是我在重定向结束时得到index.html的最后一个请求,比如:id=index.html当我访问根域时,我可以排除index.html domain.com并将其重定向到me domain.com吗?id=index.html不想在域的根上重定向。再次感谢您的大力帮助:)