2009-06-08 121 views
1

對某人應該很容易。Apache .htaccess文件重定向

我的文件在此目錄:/用戶/家庭/彼得/ mygame /生產/

我需要使用來訪問我的網站:www.foo.com/peter(這使我/用戶/家庭/彼得/)

我如何告訴Apache:

www.foo.com/peter從/用戶/家庭/彼得/ mygame /生產/

感謝讀取。

回答

1
RewriteEngine On 
RewriteBase /peter 

# To avoid the infinite loop. 
RewriteCond %{REQUEST_URI} !^/peter/mygame/production/ 
RewriteRule ^(.*)$ mygame/production/$1 [L] 

(假設這是進入 「/user/home/peter/.htaccess」。)