2010-11-27 60 views
3

背後的故事...這個正確userdir.conf的.htaccess

好吧,我嘗試用我的上網本......事情,而不必備份文件。是的,我是一個白癡:d

的問題

我有這個.htaccess文件在我的用戶目錄這是正常工作之前,我搞砸了我的partion:

Options +FollowSymLinks 

RewriteEngine On 

RewriteBase /~dierre/DierReLabS/ 

RewriteRule ^(tutorials|me|not-found|add)$ $1/ [R=301,L] 

RewriteRule ^me/$ me.php [L] 
RewriteRule ^style/$ style.css [L] 
RewriteRule ^logo/$ logo2.png [L] 
RewriteRule ^add/$ add.php [L] 
RewriteRule ^tutorials/$ tutorials.php [L] 
RewriteRule ^tutorial/([a-zA-Z0-9\-]+)/$ tutorial.php?tut=$1 [L] 
RewriteRule ^not-found/$ 404.php [L] 

# This is a real directory... 
RewriteCond %{REQUEST_FILENAME} -f [OR] 
# Or it's a real file... 
RewriteCond %{REQUEST_FILENAME} -d 
# And it's not not-found/... 
RewriteCond $0 !=not-found/ 
# And it's not the root 
RewriteCond $0 !="" 
# And it's not any of the above due to an internal redirect... 
RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
# So cause a 404 response (you could redirect to 404.php if you want) 
RewriteRule ^.*$ - [R=404,L] 

ErrorDocument 404 /~dierre/DierReLabS/not-found/ 

在用戶目錄此.htaccess無法正確使用userdir.conf中的默認參數。我沒有這個配置。目前的配置是:

<IfModule mod_userdir.c> 
     UserDir public_html 
     UserDir disabled root 

     <Directory /home/*/public_html> 
       AllowOverride FileInfo AuthConfig Limit Indexes 
       Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 
       <Limit GET POST OPTIONS> 
         Order allow,deny 
         Allow from all 
       </Limit> 
       <LimitExcept GET POST OPTIONS> 
         Order deny,allow 
         Deny from all 
       </LimitExcept> 
     </Directory> 
</IfModule> 

我真的不記得我做了什麼。你可以幫我嗎?

+0

你期待什麼,發生了什麼?我無法分辨出問題所在。 – bradym 2010-11-28 17:10:47

回答

1

感謝上帝被遺忘的筆記本電腦!我今天開始使用我的Thinkpad,並且在那裏配置了一個非更新版本的網站。

<IfModule mod_userdir.c> 
     UserDir public_html 
     UserDir disabled root 

     <Directory /home/*/public_html> 
       #AllowOverride FileInfo AuthConfig Limit Indexes 
       AllowOverride All 
       #Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 
       Options Indexes FollowSymLinks 
       <Limit GET POST OPTIONS> 
         Order allow,deny 
         Allow from all 
       </Limit> 
       <LimitExcept GET POST OPTIONS> 
         Order deny,allow 
         Deny from all 
       </LimitExcept> 
     </Directory> 
</IfModule>