The correct userdir.conf for this .htaccess

The story behind ...

Well, I experimented with my netbook ... without having backup files. Yes, I'm an idiot: D

Problem

I have this .htaccessfile in my userdir that worked correctly before I screwed my 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 a real file...
RewriteCond %{REQUEST_FILENAME} -d
# And it not not-found/...
RewriteCond $0 !=not-found/
# And it not the root
RewriteCond $0 !=""
# And it 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/

In userdir, this .htaccessdoes not work properly with the default options in userdir.conf. I no longer have such a configuration. Current configuration:

<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>

I really can’t remember what I did. Can you help me?

+3
source share
1 answer

Thank God for the abandoned laptop! I started my Thinkpad today, and there was a configuration with a non-updated version of the site.

<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>
+1
source

Source: https://habr.com/ru/post/1777133/


All Articles