背后的故事...

好的,我正在用上网本进行实验...没有备份文件。是的,我是个白痴:D

问题

我的userdir中有这个.htaccess文件,在搞砸之前,它可以正常工作:

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/

在userdir中,此.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>

我真的不记得我做了什么。你能帮助我吗?

最佳答案

感谢上帝,被遗忘的笔记本电脑!我今天开始使用我的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>

08-25 20:48