Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got strange things happen on live server, but normal in local server.
My local server is using mac, and my live server is linux.

Consider i try to access some files This work correctly. Return 404, I'm pretty sure my file is in there and there is no typo mistake.

How come it give me 404?

There is only one .htaccess on the root server and it's configuration is like this.

# For full documentation and other suggested options, please see
# including for unexpected logouts in multi-server/cloud environments
# and especially for the first three commented out rules

#php_flag register_globals Off
#AddDefaultCharset utf-8
#php_value date.timezone Europe/Moscow

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

<IfModule mod_security.c>
SecFilterEngine Off

# Fix Apache internal dummy connections from breaking [(site_url)] cache
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]

# Rewrite -> -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
#RewriteRule (.*)$1 [R=301,L]

# Exclude /assets and /manager directories and images from rewrite rules
RewriteRule ^(manager|assets)/*$ - [L]
RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]

# For Friendly URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

# Reduce server overhead by enabling output compression if supported.
#php_flag zlib.output_compression On
#php_value zlib.output_compression_level 5
share|improve this question

migrated from Oct 1 '12 at 21:59

This question came from our site for professional and enthusiast programmers.

I'm refunding your bounty on this one as you've solved it yourself. No point in throwing away good rep. – Mark Henderson Oct 8 '12 at 4:48

This rule here:

RewriteRule ^(manager|assets)/*$ - [L]

Needs to look like this:

RewriteRule ^(manager|assets)/ - [L]

Your regex is only matching the URI's /manager/ and /assets/, and not something like /assets/modules/evogallery/check.php because the /*$ at the end means no more directories, only slashes. The image URL worked because the rule after this one excludes all images.

share|improve this answer
I try your suggest, but still get 404. – GusDeCooL Oct 1 '12 at 19:54
up vote 0 down vote accepted

It's because of CHMOD, in some server we not allowed to have 777 for folder, it should be 755.
Change all folder CHMOD into 755 and it will fix the problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.