.htaccess 我的htacces?静态超链接有问题,它正在工作。如果我更改为动态超链接,它将不工作

.htaccess 我的htacces?静态超链接有问题,它正在工作。如果我更改为动态超链接,它将不工作,.htaccess,.htaccess,我的htaccess文件中有问题吗?静态超链接正在运行。如果我更改为动态超链接,则规则不起作用。我不知道htaccess文件中有什么错误。我只知道普通php。我的目标是我不想在整个网站的任何位置显示.php扩展名。有人能告诉我动态超链接中有什么错误吗。查看url,然后单击“服务”,tuiton该url工作正常。在“动态”下单击“编辑”。该url不是静态的。有人能告诉我如何正确地在htaccess文件中编写吗 # Turn mod_rewrite on RewriteEngine On Rewri

我的htaccess文件中有问题吗?静态超链接正在运行。如果我更改为动态超链接,则规则不起作用。我不知道htaccess文件中有什么错误。我只知道普通php。我的目标是我不想在整个网站的任何位置显示.php扩展名。有人能告诉我动态超链接中有什么错误吗。查看url,然后单击“服务”,tuiton该url工作正常。在“动态”下单击“编辑”。该url不是静态的。有人能告诉我如何正确地在htaccess文件中编写吗

# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} \s/+servicecnt\.php\?service_id=([^\s&]+) [NC]
RewriteRule ^ servicecnt/service_id/%1? [R=302,L]

RewriteCond %{THE_REQUEST} \s/+tuition\.php\?tuition_id=([^\s&]+) [NC]
RewriteRule ^ tuition/tuition_id/%1? [R=302,L]

RewriteCond %{THE_REQUEST} \s/+edit\.php\?id=([^\s&]+) [NC]
RewriteRule ^ edit/id/%1? [R=302,L]


RewriteRule ^servicecnt/service_id/(\d+)/?$ servicecnt.php?service_id=$1 [QSA,L]
RewriteRule ^tuition/tuition_id/(\d+)/?$ tuition.php?tuition_id=$1 [QSA,L]
RewriteRule ^edit/id/(\d+)/?$ edit.php?id=$1 [QSA,L]
我的表格:

<p style="padding-left:200px; color:red"> static link
<a  href="http://rang.comli.com/servicecnt/service_id/5">Service</a>
<a  href="http://rang.comli.com/tuition.php/tuition_id/5">Tuition</a></p>
<div align="center">
<form name="nschool" action="" method="post">
<table cellpadding="0"  cellspacing="0">
<tr>
<td height="44"></td>
<td>Titlte</td>
<td><input type="text" name="title"/></td>
<td></td>
</tr>
<tr>
<td height="49"></td>
<td>News</td>
<td><textarea name="news"></textarea></td>
<td></td>
</tr>
<tr>
<td colspan="4" style="padding-left:50px;"><input type="submit" name="submit"/></td>
</tr>
</table>
</form>
<br/>
<br/>
<p style="color:#FF0000;">Dyanmic link</p>
<table cellpadding="0" cellspacing="0">
<?php
$sql=mysql_query("SELECT * from school");
while($exe=mysql_fetch_assoc($sql))
{
?>
<Tr>
<td width="200"><?php echo $exe['title'];?>&nbsp;&nbsp;&nbsp;|</td>
<td width="200"><?php echo $exe['news'];?>&nbsp;&nbsp;&nbsp;|</td>
<Td width="88"><a href="http://rang.comli.com/edit/id/<?php echo $exe['id'];?>">Edit</a> &nbsp;&nbsp;&nbsp;|</Td>
<Td width="169"><a href="?mode=delete&id=<?php echo $exe['id'];?>" onclick="return confirm('Are you sure want to delete')"">D</a>&nbsp;&nbsp;&nbsp;|</Td>
</Tr>
<?php 
}
mysql_close($con);
?>
</table>
</div>
静态链接

滴定 新闻

动态链接

| | | |
在.htaccess顶部添加以下两行:

ErrorDocument 404 default
Options -MultiViews

选项
MultiViews
Apache的内容协商模块使用,该模块在
mod_rewrite
之前运行,并使Apache服务器匹配文件扩展名。所以
/file
可以在URL中,但它将提供
/file.php

为什么
http://rang.comli.com/edit/id/10
http://error404.000webhost.com/?
尝试在htaccess顶部添加
ErrorDocument 404 default
。好的,我会这样做的。根据您的建议我已经写了所有东西。我想你解决了这个问题。
/edit/
是目录吗?它是否也有一个.htaccess?edit是一个edit.php页面?在用户登录后编辑配置文件。不是目录。在.htaccess的顶部添加
选项-MultiViews
。最后一个查询是如何确定页面是否位于学费目录中。目录页面是学费。php?t_id=5。如果你向我解释如何编写重写条件和重写规则。我只需要一个步骤就可以了,我将学习。如果你向我解释,这对我来说是很好的经验和知识。你希望
学费
支持的确切URL是什么?别忘了解释,每件事都是动态的。这就是为什么我问动态id锚定标签。在管理部分bsc家庭学费。我想用空格来代替-就你所知,我会用htaccess或php中的stru_replace来代替。好吧,现在我认为最好现在创建一个新问题,因为
/chennai/class xi xii home Tutions class
中没有
学费id
值。所以版主不喜欢通过评论提问。好的,我会这样做。解释我如何编写重写条件和重写规则。只需一步就足够了,我将学习