dierre
dierre

Reputation: 7210

proper userdir.conf for this .htaccess

The story behind...

Ok, I was experimenting things with my netbook...without having backup files. Yes, I'm a moron :D

The Problem

I have this .htaccess file in my userdir which was working properly before I screwed up 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'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/

In the userdir this .htaccess does not work properly with the default parameters in userdir.conf. I do not have anymore that configuration. The current configuration is:

<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 recall what I did. Can you help me?

Upvotes: 3

Views: 7117

Answers (1)

dierre
dierre

Reputation: 7210

Thanks God for forsaken laptop! I've started today my Thinkpad and it was there the 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>

Upvotes: 1

Related Questions