You are not logged in.
Pages: 1
Hi,
i have the topic problem.
The htaccess file works correctly in /srv/http dir, but if i use the same file in public_html it isn't see (i think).
I googled the question but i have not find a real answer to the problem.
Can someone help me?
Sorry for my english. ![]()
PS: I have set "AllowOverride All" on: httpd.conf and the rispective config file for usersdir.
Offline
Hi!
Are you using apache2? Did you...
- Check "Set AllowOverride All" for the site the folder belongs to?
- a2dissite / a2ensite?
... or what software / setup are you using? Depending on your setup it might also be able, that the mod that does whatever you do with .htaccess is disabled for the folder (auth? Or modrewrite?)
Last edited by whoops (2009-03-26 10:38:44)
Offline
Hi! Sorry for my delay.
I'm using Apache 2 (the last version on repository), and:
1) a2dissite / a2ensite aren't present (why?)
2) i have enable, manually, AllowOverride All in httpd.conf and httpd-userdir.conf but in http://localhost/~<username>/<site> the .htaccess not work.
Sorry but i not undestand where i fail. ![]()
This is the /etc/httpd/conf/extra/httpd-userdir.conf
# Settings for user home directories
#
# Required module: mod_userdir
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
#
UserDir public_html
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
#AllowOverride FileInfo AuthConfig Limit Indexes
AllowOverride All
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>I have replace Allowoverride rule but not result.
Update: i have see that the .htaccess work for ErrorDocument directive but not for Rewrite Engine.
Can it help?
Last edited by shadowblue (2009-03-27 09:27:15)
Offline
Sorry to use your thread, but I experience the same problem. I can't get nothing to work with Apache. Neither .htaccess, custom 404 and mod_rewrite.
Isn't there anyone that might know what can cause this? As with shadowblue, I use vhost.
Offline
Offline
it's sad that this hasn't been updated. (I'm from google, if this has been resolved somewhere else, I'm sorry)
I seem to get some more output from:
<Directory /home/*/public_html>
#AllowOverride FileInfo AuthConfig Limit
AllowOverride None
Options Indexes FollowSymLinks
#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>(where AllowOverride is None)
but it's almost the same as removing the .htaccess file itself. =/
(but at least I can see the directory right? xD)
EDIT:
I see my problem.
I defined AllowOverride twice, once in the .htaccess and once in the virtual hosts directive in apache.
I have a few 404's now, but the htaccess rewrites are working.
I suggest everyone checks where they define there allowed overrides.
EOL
Last edited by Dijit (2011-06-01 07:18:23)
Offline
Well I'm having the same problem. The configuration is exactly by the book of apache I think:
UserDir public_html
<Directory "/home/*/public_html">
#AllowOverride FileInfo AuthConfig Limit Indexes
AllowOverride All
Options Indexes FollowSymLinks
#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>Even if I take a look in to .htaccess file what I have tried on sever several and distribution:
php_flag allow_url_fopen on
RewriteEngine on
# RewriteBase /home/*/public_html/site/
# RewriteCond %{HTTP_HOST} ^domain\.com [NC]
# RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ index.php?page=$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)?/?$ index.php?page=$1&page2=$2And on last step, I look in to log file where I see that:
[Tue Nov 15 20:13:08 2011] [error] [client ::1] File does not exist: /srv/http/home, referer: http://localhost/*/site/So now if I'm thinking right it's trying to find the directories in /srv/http/home, but I'm not requesting home I'm requesting different variable and why it's trying to find the directories in /srv/http if I'm using userdir. So I tried set RewriteBase in my htaccess file but same problem. To be honest I'm out of idea and I be happy when someone solve this.
Offline
And on last step, I look in to log file where I see that:
[Tue Nov 15 20:13:08 2011] [error] [client ::1] File does not exist: /srv/http/home, referer: http://localhost/*/site/So now if I'm thinking right it's trying to find the directories in /srv/http/home, but I'm not requesting home I'm requesting different variable and why it's trying to find the directories in /srv/http if I'm using userdir. So I tried set RewriteBase in my htaccess file but same problem. To be honest I'm out of idea and I be happy when someone solve this.
I'm also having the same problem. My only solution is to change DocumentRoot in /etc/httpd/conf/httpd.conf from "/srv/http" to "/home/$user$/public_html" where $user$ is your username and restart apache.
EDIT:
This also lets you use Options +FollowSymLinks in your .htaccess
Last edited by JJ.Eastwood (2011-12-21 18:16:42)
Offline
First off, check to make sure mod_userdir is compiled or defined. It seems like the .htaccess files aren't coming into play yet because apache is not going to the right folder to read it in the first place.
httpd (or apache2ctl) --fullstatusyou should see a listing of modules in use there.
Also check your error_log.
if at some point you are getting 403s you may need to make sure you have permissions 755(folders) and 644(files)
If you have mod_userdir enabled, pastebin your apache configuration and post a line from the error log in case the error is different for any of you. Apache can be a real pain at times.
RAID !=backup
Offline
Pages: 1