请帮我解决这个问题。我一直在努力与htaccess一段时间。 我有一个链接索引页beedy.php必须传递一些参数,如htaccess重写规则显示错误
<a href=”beedy.php?user=1”>Link 1</a>
,但我不希望它展现给用户,所以我写了这样的 链接1 用户价值是1这里 哪些工作正常。但在beedy.php页面上,我有另一个链接,应该带我到我们的页面。但是,当我点击链接时显示的页面未找到(请求的URL/mvc/bd/bolade/1/seeOtherLink/About /在此服务器上找不到)。 我搜索了谷歌,但没有一个足够说明问题。
我的项目是这样构造的。 的mvc - > BD-> MVC的是该项目的父文件夹,而BD是我有我的
工作index.php页面如下
<html>
<head> <title>Hey</title></head>
<body>
<h1 > THIS IS HOME PAGE </h1>
<a href="bolade/1/"> Link 1 </a>
<br />
<a href="bolade/2/">Link 2</a>
</body>
</html>
我有其他文件我的.htaccess文件结构像这样
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase/
#Rewrite beedy URLs
# Input: user/NAME/
# Output: beedy.php?id=userId
RewriteRule ^bolade/(\w+)/?$ beedy.php?user=$1 [L]
#this should take me to about page, or any page that starts with seeOtherLink/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule^seeOtherLink /(\w+)$ $1.php
</IfModule>
Beedy.php页面如下
<html>
<head><title>Hey Beedy</title></head>
<body>
<a href="seeOtherLink/About/"> Go to About Us</a>
<br />
<a href="seeOtherLink/Contact/"> Go to Contact Us</a>
<br />
<?php
$id = $_GET['user'];
switch($id){
case 1:
echo "This is the First value";
break;
case 2:
echo "This is the Second value";
break;
}
?>
</body>
</html>
尝试删除您的网址中的空格 –
我做了,但结果仍然相同 –