2011-12-02 143 views
0

您好我需要使用位於根文件夾中的這個現有的htaccess。 我現在需要創建一個新的目錄/ testfolder /成爲http://www.companydomain.com/testfolder/,其中根的所有文件將被定位。htaccess更改目錄

我該如何使這個現有的htaccess發生?非常感謝您的幫助!

Options +FollowSymLinks 
RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_URI} !(.*)/$ 
RewriteCond %{REQUEST_URI} !(.*)/(.*).html$ 
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301] 

# 301 
RewriteCond %{HTTP_HOST} !^www\.companydomain\.com$ [NC] 
RewriteRule .? http://www.companydomain.com%{REQUEST_URI} [R=301,L] 
RewriteRule ^Sportsbooks\/(.*).html$ Sportsbooks\/$1\/ [R=301,L] 

回答

0

.htaccess文件將重定向到​​http://example.com/folder1/file.html

Options +FollowSymLinks 
RewriteEngine On 
RewriteCond %{HTTP_HOST} example.com$ [NC] 
RewriteCond %{HTTP_HOST} !folder1 
RewriteRule ^(.*)$ http://example.com/folder1/$1 [R=301,L] 

我希望這有助於!

+0

嗨im無限循環重定向 –