Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
http://redddor.babonmultimedia.com/assets/images/map-1.jpg This work correctly.
http://redddor.babonmultimedia.com/assets/modules/evogallery/check.php 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
# http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
# 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
</IfModule>

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

# Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
#RewriteRule (.*) http://www.example.com/$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 stackoverflow.com Oct 1 '12 at 21:59

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

1  
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

2 Answers 2

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

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

Your Answer

 
discard

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.