.htaccess redirect domain.com/whatever to domain.com/index.html?domain = whatever

时间:2014-11-05 12:25:03

标签: apache .htaccess mod-rewrite redirect

我如何重定向:

domain.com/whatever

domain.com/login.html?domain=whatever

1 个答案:

答案 0 :(得分:0)

这很简单,我认为你没有足够的搜索。

您可以在DOCUMENT_ROOT/.htaccess文件中使用此代码:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+) index.html?domain=$1 [L,QSA]