2013-02-12 32 views
5

ile 404 hatası üzerinde bir php/html dosyasına yönlendirme Örneğin, tüm 404 hatalarını "404.php" olarak yeniden yönlendirmek istiyorum..htaccess

.htaccess içinde ErrorDocument 404 /404.php kullanmayı denedim, ancak şans olmadan, belki de diğer kurallarım buna izin vermiyor, bu bilgiyi www olarak bulamadığımdan emin değilim.

Bunu çözebilecek nasıl fikriniz varsa

, bağırmak lütfen: P

Bulunduğum .htaccess hata belge için tam URL'yi koyarak çözüldü

#### pie thingy #### 
AddType text/x-component .htc 

#### Rule for Error Page - 404 #### 
ErrorDocument 404 /404.html 

#### url rewriting #### 
Options +FollowSymlinks 
RewriteEngine on 

#### REDIRECT IF NO SUB-DOMAIN #### 
RewriteCond %{HTTP_HOST} ^([^.]+)\.([^.]+)$ [NC] 
RewriteRule ^(.*)$ http://www.%1.%2/$1 [R=301,L] 

#### Remove "www." from any subdomain requests #### 
RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.precisehire\.com [NC] 
RewriteRule (.*) http://%1.precisehire.com/$1 [R=301,L] 

#### Rules for rewriting from PHP to HTML with fallback #### 
RewriteCond %{REQUEST_URI} ^/(.*)\.html$ 
RewriteCond %{DOCUMENT_ROOT}/%1.php -f 
RewriteRule ^(.*)\.html$ $1.php [nc] 

cevap

12

.

Örnek:

#### Rule for Error Page - 404 #### 
ErrorDocument 404 http://www.domain.com/404.html