2012-05-04 91 views
0

我正面臨與我的腳本錯誤404。404錯誤和.htaccess

我想隱藏頁面標題。例如

http://example.com/final/admin/admin.php

我想隱藏admin.php

http://example.com/final/admin

這裏是我的.htaccess總是返回404頁找不到錯誤

RewriteEngine On 

RewriteCond %{REQUEST_URI} !^/final/.*$ 
RewriteRule ^(.*)$ /final/$1 [L] 

這裏是我的index.php代碼

<?php 

/** 
* @author Mina Wilson 
* @copyright 2012 
* // EPCI Pharma Survey | Rights Reserved 
*/ 
// Inialize session 
session_start(); 
echo $_SESSION['message']; unset($_SESSION['message']); 


ob_start(); 

session_destroy(); 

// Check, if user is already login, then jump to secured page 

ob_start(); 
if (isset($_SESSION['name'])) { 

header('Location: login_process.php'); 
} 

ob_flush(); 
?> 
-- html here 

誰能告訴我有什麼問題嗎?

回答

0

使用這樣的重寫小冊子。您可以使用重寫規則單獨

RewriteRule final/(.*)$ index.php?page=$1 [NC,L] 

但最後一句話後,這個重定向任何網頁的index.php

+0

不工作,我做了更改編碼什麼? –

+0

爲什麼使用ob_start()?在銷燬會話後,你正在檢查是否(isset($ _ SESSION ['name'])),那麼它將如何工作? – nithi

+0

我認爲如果您刪除所有代碼並僅放置下面的代碼會更好。 <?php session_start();如果isset($ _ SESSION ['name'])){ header('Location:login_process.php'); } – nithi