Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
Apache 如果访问不工作,我做错了什么?_Apache_.htaccess_Mod Rewrite_Rewrite - Fatal编程技术网

Apache 如果访问不工作,我做错了什么?

Apache 如果访问不工作,我做错了什么?,apache,.htaccess,mod-rewrite,rewrite,Apache,.htaccess,Mod Rewrite,Rewrite,这就是我的htaccess文件的样子 # Turn rewriting on Options +FollowSymLinks RewriteEngine On RewriteBase /dev RewriteRule ^novost/([a-zA-Z]+)/([a-zA-Z]+)/$ novosturl.php?category=$1&news=$2 通常,我的url看起来像/novosturl.php?category=CATNAME&news=NEWSNAME 我想做的是让它成为n

这就是我的htaccess文件的样子

# Turn rewriting on
Options +FollowSymLinks
RewriteEngine On
RewriteBase /dev
RewriteRule ^novost/([a-zA-Z]+)/([a-zA-Z]+)/$ novosturl.php?category=$1&news=$2
通常,我的url看起来像/novosturl.php?category=CATNAME&news=NEWSNAME

我想做的是让它成为novost/CATNAME/NEWSNAME

我在htdocs中的文件夹是/dev,因此我将rewritebase设置为/dev


我在哪里出错了?

这个htaccess在/dev文件夹中吗?是的,它在/dev文件夹中。您在浏览器中键入的url是什么?recenzije和urlartkila是category和news name(它们在直接访问时工作)@Adi:我认为您应该使用像localhost/dev/novost/1/3、、localhost/dev/novost/{id=number}/{id2=number}这样的id号