0
我想將任何子站點重定向到主URL。在.htaccess中修改URL
從
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
我想example.com/webone/two重定向到example.com,無/ webone /兩 – puppeteer701
重定向/ webone /兩http://example.com/ –
我想我需要某種類型的正則表達式,它會採用任何類型的子表達式並將它們重定向到索引 – puppeteer701