這個區域不是我最強的區域。但感覺我有一個大概的瞭解。.htaccess問題頁面,像文件夾訪問圖像
好的,所以我的問題是這樣的。我有一個公司爲我出於某種原因,這些都可以訪問工作:
http://www.pets4you.com/cats/(錯了,應該不能夠也沒有文件夾叫貓) http://www.pets4you.com/cats.html(正確的網址)
獲取更好: pets4you .COM /圖片/分類/ ad_8e286189f9c4e622ea12ebdcdd10b646(咦?) pets4you.com/images/classifieds/ad_8e286189f9c4e622ea12ebdcdd10b646.jpg
(無法建立網址,2鏈接這裏限制我猜)
我的主人ing公司告訴我這是:
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
我告訴他們他們錯了。這是一個跟蹤和評論,沒有改變。
任何方式,我的代碼(是的,東西很多,告訴我的老闆!):
Options +FollowSymLinks
Options -Indexes
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule^http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
</IfModule>
RewriteRule ^(.*\.(css|js))$ min/index.php?f=$1&debug=0 [L]
RewriteRule ^(.*)index.php$ http://www.pets4you.com/$1 [R=301,L]
# BEGIN COMPRESSION AND CACHING
<IfModule mod_deflate.c>
# Enable compression
# AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript text/html text/plain text/xml image/x-icon
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
<IfModule mod_setenvif.c>
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>
<IfModule mod_headers.c>
# Make sure proxies deliver correct content
Header append Vary User-Agent env=!dont-vary
# Ensure proxies deliver compressed content correctly
Header append Vary Accept-Encoding
</IfModule>
</IfModule>
<IfModule mod_headers.c>
# No ETags, No Pragma
Header unset Pragma
Header unset ETag
# Default cache time to 1 year (31536000 sec)
Header set Cache-Control "max-age=31536000, public, must-revalidate"
</IfModule>
# No ETags
FileETag none
# CACHE SETTINGS (mod_expires)
<IfModule mod_expires.c>
# Turn on Expires
# set default to "access plus 1 year"
ExpiresDefault A31536000
ExpiresActive On
# html - "modification plus 1 hour"
ExpiresByType text/html M3600
# css and JavaScript - "modification plus 6 weeks"
ExpiresByType text/css M3628800
ExpiresByType text/javascript M3628800
ExpiresByType application/x-javascript M3628800
</IfModule>
# No cache for php-files
<FilesMatch "\.(php)$">
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
</IfModule>
</FilesMatch>
<IfModule mod_php5.c>
#php_value output_handler ob_gzhandler
php_flag display_errors Off
php_flag log_errors On
php_value upload_max_filesize 500M
php_value post_max_size 500M
php_value memory_limit 1000M
php_flag zlib.output_compression on
php_value zlib.output_compression_level 2
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
php_flag zend.ze1_compatibility_mode Off
php_value mbstring.func_overload 0
php_flag suhosin.session.encrypt Off
php_value session.auto_start 0
php_value session.gc_maxlifetime 54000
php_value session.gc_divisor 500
php_value session.gc_probability 1
php_value mysql.connect_timeout 1000
php_value mysql.allow_persistent Off
</IfModule>
##############
# ERROR PAGES#
##############
ErrorDocument 401 /errors.php?code=401
ErrorDocument 500 /errors.php?code=500
ErrorDocument 403 /errors.php?code=403
ErrorDocument 400 /errors.php?code=400
ErrorDocument 404 /errors.php?code=404
######################
# BREED DESCRIPTIONS #
######################
RewriteRule ^dog_breed_description/teapoodle/?$ http://www.pets4you.com/dog_breed_description/poodle/ [R=301,L]
RewriteRule ^dog_breed_description/toypoodle/?$ http://www.pets4you.com/dog_breed_description/poodle/ [R=301,L]
RewriteRule ^dog_breed_description/([^/]+) descriptions.php?page=$1 [NC]
RewriteRule ^cat_breed_description/([^/]+) descriptions.php?page=$1 [NC]
############
# CALENDAR #
############
#RewriteRule ^submitevent.html calendar.php?action=submitEvent [NC]
#RewriteRule ^calendar/([^/]+)/([^/]+)/([^/]+)/([^/]+) errors.php?code=404 [NC]
#RewriteRule ^calendar/([^/]+)/([^/]+)/([^/]+) errors.php?code=404 [NC]
#RewriteRule ^calendar/([^/]+)/([^/]+) calendar.php?year=$1&month=$2 [NC]
#RewriteRule ^calendar/([^/]+) calendar.php?year=$1 [NC]
#RewriteRule ^calendar/ calendar.php [NC]
#################
# PET DIRECTORY #
#################
RewriteRule ^petsupplies/dogs/(.*).html/?$ directory.php?type=dog&page=$1 [QSA,L]
RewriteRule ^petsupplies/cats/(.*).html/?$ directory.php?type=cat&page=$1 [QSA,L]
RewriteRule ^petsupplies/(.*).html/?$ directory.php?page=$1 [QSA,L]
RewriteRule ^petsupplies/search.php?$ directory.php?page=search [QSA,L]
RewriteRule ^petsupplies/?$ http://www.pets4you.com/petsupplies.html [R=301,L]
###############
# PET GALLERY #
###############
RewriteRule ^gallery/([^/]+) gallery.php?breed=$1 [QSA,L]
RewriteRule ^gallery/?$ gallery.php [QSA,L]
RewriteRule ^gallery/index.html?$ gallery.php [R=301,L]
############
# ARTICLES #
############
RewriteRule ^petarticles/([^/]+) articles.php?action=a&id=$1 [NC]
RewriteRule ^petarticles/?$ http://www.pets4you.com/petarticles.html [R=301,L]
RewriteRule ^petarticles?$ http://www.pets4you.com/petarticles.html [R=301,L]
RewriteRule ^petarticles.html/?$ articles.php [L]
RewriteRule ^articles_search.php/?$ articles.php [QSA,L]
################
# LOST & FOUND #
################
RewriteRule ^lost_found.html/?$ lost_found.php [QSA,NC,L]
########
# DOGS #
########
RewriteRule ^studservice.html?$ http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^puppiesforsale/([^/]+) http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^dogs/([^/]+) http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^dogs/ http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^dogs.html?$ dogs.php?start=0 [QSA,L]
RewriteRule ^dogs1/?$ dogs.php?start=1 [QSA,L]
RewriteRule ^dogs2/?$ dogs.php?start=2 [QSA,L]
RewriteRule ^cats/ http://www.pets4you.com/cats.html [R=301,L]
RewriteRule ^cats.html/?$ cats.php [L]
RewriteRule ^puppiesforsale.html?$ http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^teapoodle.html?$ http://www.pets4you.com/poodle.html [R=301,L]
RewriteRule ^toypoodle.html?$ http://www.pets4you.com/poodle.html [R=301,L]
#############
# BREEDERS #
############
#RewriteRule ^dogbreeders/([^/]+) dog_breeders.php?breed=$1 [NC]
#RewriteRule ^dogbreeders/?$ http://www.pets4you.com/dog_breeders.html [R=301,L]
#RewriteRule ^dogbreeders.html/?$ dog_breeders.php [L]
#RewriteRule ^catbreeders/([^/]+) cat_breeders.php?breed=$1 [NC]
#RewriteRule ^catbreeders/?$ http://www.pets4you.com/cat_breeders.html [R=301,L]
#RewriteRule ^catbreeders.html/?$ cat_breeders.php [L]
################
# STATE PET ADS #
################
RewriteRule ^localpetads/(.*).html?start=([0-9])/?$ http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^localpetads/(.*).html/?$ http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^localpetads.html?$ http://www.pets4you.com/localpetads/ [R=301,L]
RewriteRule ^localpetads/([^/]+)/([^/]+) http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^localpetads/([^/]+) http://www.pets4you.com/dogs.html [R=301,L]
RewriteRule ^localpetads/ http://www.pets4you.com/dogs.html [R=301,L]
###########
# GENERAL #
###########
RewriteRule ^sitemap.html?$ sitemap.php?start=1 [QSA,L]
RewriteRule ^sitemap2/?$ sitemap.php?start=2 [QSA,L]
RewriteRule ^sitemap3/?$ sitemap.php?start=3 [QSA,L]
RewriteRule ^sitemap4/?$ sitemap.php?start=4 [QSA,L]
RewriteRule ^terms.html/?$ terms.html [L]
RewriteRule ^google97ce2a2538777af1.html/?$ google97ce2a2538777af1.htm [L]
RewriteRule ^googlef7b2dff2a5d7b41b.html/?$ googlef7b2dff2a5d7b41b.htm [L]
RewriteRule ^dogvideos/ videos.php [NC]
RewriteRule ^topdogs/ breedratings.php [NC]
RewriteRule ^(.*).html/?$ pets4you.php?page=$1 [QSA,L]
此外,有時當我輸入「www.pets4you.com」它引導到https( ?) 別的東西讓我無能爲力。
不是我最強的區域,.htaccess。任何錯誤都會讓我知道。所有重定向工作正常。讓我想起其他事情是由什麼引起的。
謝謝!
並指出,即使總是有一些差異。當我在本地機器上運行這個相同的文件時,以上都不會發生。只有在託管服務器上運行時纔有效。 –
你是否繼承了那個爛攤子,或者你在幹什麼? – aefxx