Forum Moderators: phranque
Here is the code
-------------------------------------------------------------
<Files .htaccess>
order allow,deny
deny from all
</Files>
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.mysite.com$ [NC]
RewriteRule ^(.*)$ [mysite.com...] [R=301,L,NC]
ServerSignature EMail
SetEnv SERVER_ADMIN mailto:myemail@hotmail.com
Options -Indexes
-------------------------------------------------------
I have tried tried commenting everything else out (including the rewrite rules and cond) but even with a file that only has a the RewriteEngine on the awstats is still forbidden
Awstats is located at /awstats/awstats.pl <- symlink
Thanks for any help!
I'd suggest you contact your host with this problem, after removing (not just commenting-out) all of the lines except the Options and RewriteEngine directives. They may give you a line about "We don't support mod_rewrite," and if so, you may be able to get away with insisting that they should at least support being able to enable it. If not, you basically need a new host.
Be sure you are completely flushing your browser cache after changing the code. Failing to do so can lead to apparently-bizarre test results, since your browser will cache both previously-loaded pages and their corresponding server responses (such as 403 or 500 errors).
You might also want to take a look at your server error log -- It can be quite informative.
Jim
--------------------------------------------------------------------
<VirtualHost *>
ServerAdmin myemail@hotmail.com
ServerName mysite.com
ServerAlias *mysite.com
DocumentRoot /var/www/personal/
<Directory />
Options FollowSymLinks
AllowOverride none
</Directory>
<Directory /var/www/personal/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/personal-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/personal-access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "/var/www/personal/awstats/classes/"
Alias /awstatscss "/var/www/personal/awstats/css/"
Alias /awstatsicons "/var/www/personal/awstats/icon/"
ScriptAlias /awstats/ "/var/www/personal/awstats/cgi-bin/"
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "/var/www/personal/awstats">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
</VirtualHost>
-----------------------------------------------------------------------
Again the problem is that when I have the rewriteEngine on in the root directory the website address changes correctly but I can't seem to access the awstats page. As soon as I comment out the rewriteEngine, awstats works again... Argh!
Disable MultiViews completely (in all contexts) if you don't use them. They generate 'rewrites' and can confuse mod_rewrite debugging.
The interference of RewriteEngine on with your awstats is even more perplexing, considering that you've got awstats ScriptAliased to a directory that does not share your .htaccess file. Look in all directories below your .htaccess file for other mod_rewrite directives that might be getting enabled.
That's all I can say without knowing what's in your error log.
Jim
[Mon Aug 18 23:09:12 2008] [error] [client 192.***.0.***] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/personal/awstats/cgi-bin/awstats.pl, referer: http://www.example.com/html/admin.html
[edited by: jdMorgan at 2:04 pm (utc) on Aug. 19, 2008]
[edit reason] example.com [/edit]