PDA

View Full Version : سوال: مشکل با فایل htaccess



soroush.r70
یک شنبه 18 دی 1390, 19:59 عصر
من یه فایل htaccess که داخل localhost جوابگو نیست و error 500 می ده کداشم اینه :


<Files ~ "^.(htaccess|htpasswd)$">
deny from all
</Files>
Options Indexes
ErrorDocument 404 http://www.realdesign.ir/404.php/
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(aaa\.ir)(:80)? [NC]
RewriteRule ^(.*) http://www.aaa.ir/$1 [R=301,L]
DirectoryIndex index.php
order deny,allow
deny from 127.0.0.1
# BEGIN Compress text files
<ifModule mod_deflate.c>
<filesMatch "\.(css|js|x?html?|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</ifModule>
# END Compress text files
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "max-age=216000, private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "max-age=600, private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers
# BEGIN Turn ETags Off
<ifModule mod_headers.c>
Header unset ETag
</ifModule>
FileETag None
# END Turn ETags Off
# BEGIN Remove Last-Modified Header
<ifModule mod_headers.c>
Header unset Last-Modified
</ifModule>
# END Remove Last-Modified Header
AddType text/html .shtml
AddHandler server-parsed .shtml
Indexed FollowSymLinks Includes Options
RewriteEngine on
$^! {RewriteCond %{HTTP_REFERER
RewriteCond %{HTTP_REFERER}
[NC] $*./!^http://(www\.)?aaa.ir
RewriteRule \.(gif|jpg|png)$
[R,L] http://www.aaa.ir/images/logo-small.gif
## Enable Mod Rewrite, this is only required once in each .htaccess file
RewriteEngine On
RewriteBase /
## Test for access to includes directory
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /includes/ .*$ [NC]
## Test that file requested has php extension
RewriteCond %{REQUEST_FILENAME} ^.+\.php$
## Forbid Access
RewriteRule .* - [F,NS,L]
<FilesMatch "^php5?\.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ [a-zA-Z0-9\.\+_/\-\?\=\&]+\ HTTP/ [NC]
RewriteRule .* - [F,NS,L]
AddType application/x-httpd-php .asp .jsp
AddType text/html .shtml
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes
AddDefaultCharset utf-8
<Limit POST PUT DELETE>
</Limit>
<LimitExcept POST GET>
</LimitExcept>
<IfDefine ReverseProxy>
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/libproxy.so
</IfDefine>
Options +FollowSymlinks
RewriteEngine On
rewritecond %{REQUEST_FILENAME} !^(.+).css$
rewritecond %{REQUEST_FILENAME} !^(.+).js$
rewritecond %{REQUEST_FILENAME} !file.php$
RewriteRule ^(.+)$ /404.php/ [nc]
php_flag register_globals on

چی کار کنم در ضمن از mode rewrite هم استفاده می کنم خطا می ده

LoadModule rewrite_module modules/mod_rewrite.so هم فعال هست

دوستان منو راهنمایی کنین چرا این مشکلات ایجاد می شه باید چیزی رو فعال کنم ...؟

soroush.r70
دوشنبه 19 دی 1390, 10:48 صبح
جواب نمی دین..؟؟

Mr.Moghadam
دوشنبه 19 دی 1390, 12:59 عصر
خط زیر رو بردار شاید درست بشه :


deny from 127.0.0.1

soroush.r70
دوشنبه 19 دی 1390, 13:23 عصر
نه آقا بازم حل نشد هنوزم error 500 می ده