Forum Moderators: phranque
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
it shows my www.example.com mainpage by default.
However when I access :
www.example.com/awstats
it shows the mainpage (wordpress) instead of awstats. however awstats folder exists with its own files etc.
Any idea how to fix this?
[edited by: jdMorgan at 5:09 pm (utc) on Jan. 9, 2008]
[edit reason] example.com & formatting [/edit]
The code says:
If requested URL does not resolve to an existing file AND
If requested URL does not resolve to an existing directory THEN
Rewrite requests for any (non-blank) URL-path to example.com/index.php
However, since I don't know how your site is set up, or how it is supposed to work, that's all I can offer. Hopefully, that may help you narrow down the problem.
Jim
Well, for some reason , when I access:
www.domain.com/awstats/awstats.pl, it will still resolve to index.php. I have verified that I have the file over at awstats/awstats.pl
But if I create another directory and put files in it, and open that file, it works...
Suggestions? Or is it possible to edit the Rewrite condition to ignore one directory? If yes, how do I modify it to ignore the folder awstats?
P.s: Also if I rename the .htaccess, I will be able to access awstats... So the prob is with .htaccess...
In other words, the most likely problem is that %{REQUEST_FILENAME} is not resolving to the correct filepath for some reason. Therefore, the 'file exists' and 'directory exists' checks fail even for existing files/dirs.
You can expose the path by using a redirect. Use a (temporary!) rule like this to see the REQUEST_FILENAME path in your browser address bar:
RewriteRule ^awstats/(.*)$ http://www.example.com/$1?FilePath=%{REQUEST_FILENAME} [R=301,L]
Jim
Alias, that i'm not too sure - but I'm seeing the folder "awstats" in my File Manager tho :P
Is there anyway to fix this issue by modifying .htaccess since this is the file which is actually causing the issue...?
Thanks for your help again Jim!
By 'build' a path, I am not suggesting anything that you cannot do. What I mean is to replace
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{DOCUMENT_ROOT}<extra_path_info>/%{REQUEST_URI} -f
Alternatively, you might try simply disabling the rule if the request is for /awstats by adding another RewriteCond ahead of the others:
RewriteCond %{REQUEST_URI} !^/awstats/
[edited by: jdMorgan at 4:23 am (utc) on Jan. 10, 2008]
The error log shows:
[codes][Thu Jan 10 00:21:41 2008] [error] [client 102.111.xx.xx] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[/codes]
Hmm... Maybe the rewritecond is ... wrong?