修改.htaccess中的URL

时间:2017-07-16 06:22:14

标签: apache .htaccess

我想将任何子网站重定向到主网址。

http://example.com/one/two

http://example.com/

这是我目前的.htaccess



DirectoryIndex index.html index.php index.htm parking-page.html

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.html?path=$1 [NC,L,QSA]

RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^/?$ "http\:\/\/example\.com\/" [R=301,L]

#RewriteRule ^example\.org.? example\.org? [L]

RewriteCond %{QUERY_STRING} .
RewriteRule (.*) $1?

FallbackResource index.html




1 个答案:

答案 0 :(得分:0)

试试这个:

RewriteRule (.*) /webone/two