2017-07-16 3 views
0

Ich möchte jede Unter-Site zur Haupt-URL umleiten.URL in .htaccess ändern

Von

http://example.com/one/two

Um

http://example.com/

Dies ist meine aktuellen .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

Antwort

0

Versuchen Sie folgendes:

RewriteRule (.*) /webone/two 
+0

I example.com/webone/two zu example.com umleiten möchten, ohne/webone/zwei – puppeteer701

+0

Redirect/webone/zwei http://example.com/ –

+0

Ich denke, ich brauche eine Art Regex, die jede Art von Subs benötigt und sie zum Index weiterleitet – puppeteer701