2009-02-13 35 views
5

Tôi đã sao chép các tệp và cơ sở dữ liệu từ BradPPresents.com đến BradP.com..HTACCESS Tệp gây ra Lỗi Máy chủ Nội bộ

Tệp .htaccess là bắt buộc để các trang hiển thị chính xác vì "URL đẹp" được bật bởi joomla !.

Bạn có thể thấy rằng cơ sở dữ liệu và tất cả các kết nối đang hoạt động tại http://bradp.com/index.php, tuy nhiên http://bradp.com/home.html không hoạt động vì nó dựa trên tệp .htaccess để phân tích URL.

Tôi đã sao chép tệp htaccess giống hệt từ bradppresents.com (hiện đang hoạt động tốt) thành bradp.com và tôi nhận được "Lỗi máy chủ nội bộ" khi tệp có mặt. Ngay sau khi nó bị xóa, lỗi sẽ biến mất, nhưng tất nhiên trang web không hoạt động khi cần thiết.

Tôi hy vọng ai đó có thể tỏa sáng một chút về điều này cho tôi.

Dưới đây là các tập tin .htaccess

RewriteEngine On 
RewriteBase/

RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|\.aspx|\.asp|/[^.]*)$ [NC] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule (.*) index.php 

## This attempts to block the most common type of exploit `attempts` to Joomla! 
# 
# Block out any script trying to set a mosConfig value through the URL 
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] 
# Block out any script trying to base64_encode crap to send via URL 
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] 
# Block out any script that includes a <script> tag in URL 
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] 
# Block out any script trying to set a PHP GLOBALS variable via URL 
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] 
# Block out any script trying to modify a _REQUEST variable via URL 
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
# Send all blocked request to homepage with 403 Forbidden error! 
RewriteRule ^(.*)$ index.php [F,L] 

#max files size restrictions 
php_value upload_max_filesize 20M 
php_value post_max_size 20M 

Dưới đây là các tập tin cấu hình trang web từ Apache.

<VirtualHost *:80> 
     ServerAdmin [email protected] 

     DocumentRoot /home/nick/public_html/bradp.com/html/ 
     <Directory /> 
       Options FollowSymLinks 
       AllowOverride All 
     </Directory> 
     <Directory /home/nick/public_html/bradp.com/html/> 
       Options Indexes FollowSymLinks MultiViews 
       AllowOverride All 
       Order allow,deny 
       allow from all 
     </Directory> 

     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
     <Directory "/usr/lib/cgi-bin"> 
       AllowOverride None 
       Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
       Order allow,deny 
       Allow from all 
     </Directory> 

     ErrorLog /var/log/apache2/error.log 

     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 

     CustomLog /var/log/apache2/access.log combined 
     ServerSignature On 

    Alias /doc/ "/usr/share/doc/" 
    <Directory "/usr/share/doc/"> 
     Options Indexes MultiViews FollowSymLinks 
     AllowOverride None 
     Order deny,allow 
     Deny from all 
     Allow from 127.0.0.0/255.0.0.0 ::1/128 
    </Directory> 

</VirtualHost> 

Về bản chất, đó là tệp mặc định với một vài thay đổi.

Tôi thực sự đánh giá cao bất kỳ trợ giúp nào tôi có thể nhận được; Cảm ơn một triệu, Nick

+1

Trước khi hỏi bạn có nên xem xét các tệp nhật ký không. – Gumbo

+0

Thậm chí không nghĩ để kiểm tra điều đó. Cảm ơn. –

Trả lời

8

Nhìn vào nhật ký lỗi của bạn để xem thông báo lỗi chính xác.

Nhưng vì bạn nói "đã sao chép" trong câu đầu tiên, tôi cho rằng bạn đang chuyển từ máy chủ này sang máy chủ khác. Nguyên nhân có nhiều khả năng nhất là mô-đun rewrite không được tải trên máy chủ mới.

+0

Tôi cảm thấy như một thằng ngốc hoàn toàn. Bạn đúng 100%. Hoạt động ngay bây giờ với chức năng ghi đè mod được bật. –

Các vấn đề liên quan