Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我正在尝试使用URL重写_Url_Rewrite - Fatal编程技术网

我正在尝试使用URL重写

我正在尝试使用URL重写,url,rewrite,Url,Rewrite,此脚本不起作用。是因为我还在使用localhost进行测试吗 Options +FollowSymLinks RewriteEngine on RewriteRule readnews-news_art_id-(.*)\.html$ readnews.php?news_art_id=$1 看起来不错。 检查您的服务器端权限。 “不工作”是什么意思 你有错误500吗? 如果是这样的话,您可能需要在Web服务器配置中允许覆盖该目录中的所有内容。我不擅长.htaccess,但是我刚刚用本地主机测试了

此脚本不起作用。是因为我还在使用localhost进行测试吗

Options +FollowSymLinks
RewriteEngine on
RewriteRule readnews-news_art_id-(.*)\.html$ readnews.php?news_art_id=$1
看起来不错。 检查您的服务器端权限。 “不工作”是什么意思 你有错误500吗?
如果是这样的话,您可能需要在Web服务器配置中允许覆盖该目录中的所有内容。

我不擅长.htaccess,但是我刚刚用本地主机测试了我的简单重写规则,它们工作正常,所以不,这不是由于本地主机:-)谢谢您解决了这个问题。我不知道我必须将我的链接URL更改为nee URL。请问如何保护.htaccess文件?入侵者是否可以覆盖或删除它?