CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Apache configuration (http://www.codingforums.com/forumdisplay.php?f=69)
-   -   403 error under mod_rewrite and .htaccess (http://www.codingforums.com/showthread.php?t=270041)

hanpedro 08-09-2012 04:56 AM

403 error under mod_rewrite and .htaccess
 
I have a 403 error under mod_rewrite and .htaccess.


The httpd error log message is,

Quote:

/var/www/html/usersite/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
And the setting of mod_rewrite is this.

At httpd.conf,

Code:

DocumentRoot "/var/www/html"

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/html">
    Options FollowSymLinks ExecCGI Includes

    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

At httpd-vhosts.conf,

Code:

<VirtualHost *:80>
ServerAdmin webmaster@server2.net
DocumentRoot /var/www/html/usersite
ServerName usersite.dyndns.org
ServerAlias www.usersite.dyndns.org
  <Directory /var/www/html/usersite/>
  AllowOverride all
  </Directory>
#php_admin_flag allow_url_fopen On
CustomLog "|/opt/lampp/bin/rotatelogs /opt/lampp/logs/usersite.dyndns.org_access_log.%Y-%m-%d 86400 +540" common
ErrorLog "|/opt/lampp/bin/rotatelogs /opt/lampp/logs/usersite.dyndns.org_error_log.%Y-%m-%d 86400 +540"
</VirtualHost>

At .htaccess,

Code:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteRule ^([a-zA-Z0-9_]+)$ blog/index\.php\?mb_id=$1
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)$ blog/index\.php\?mb_id=$1&id=$2
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)/([0-9]+)$ blog/index\.php\?mb_id=$1&yyyy=$2&mm=$3&dd=$4
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/([0-9]+)$ blog/index\.php\?mb_id=$1&yyyy=$2&mm=$3
</IfModule>

Please let me know what I am wrong.

Thanks in advance.

Inigoesdr 08-10-2012 04:22 AM

Check the permissions on the /var/www/html/usersite/.htaccess file. The error message you posted says specifically that it can't be read, so the read permissions may have been removed or the user apache is running as doesn't have access to the file.

hanpedro 05-07-2013 10:47 AM

Inigoesdr/

I appreciate your kindness.


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.