這是我的index.php文件。寫入.htaccess文件以通過index.php重定向url,但沒有找到錯誤對象
<?php
$url=getCurrentURL();
$path=parse_url($url, PHP_URL_PATH);
$a= str_replace('/', '', $path);
echo $a;
function getCurrentURL()
{
$currentURL = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
$currentURL .= $_SERVER["SERVER_NAME"];
if($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443")
{
$currentURL .= ":".$_SERVER["SERVER_PORT"];
}
$currentURL .= $_SERVER["REQUEST_URI"];
return $currentURL;
}
?
我已虛擬承載這個由xampp.My的要求是,我想要的URL路徑被打印。例如,我用www.salary.dev.if託管了這個,我輸入www.salary.dev/ibm,我想讓ibm打印。但是當我輸入這個時,我得到了404錯誤。然後我知道我們想寫這個.htaccess文件這個。我不知道如何寫。請幫助我編寫路由的.htaccess文件不存在。請幫助我。提前感謝。
可能重複[重定向所有index.php htaccess](https://stackoverflow.com/questions/18406156/redirect-all-to-index-php-htaccess) – Philipp
no use.any other。 – Pranav
你是否需要處理錯誤文檔? –