mod_rewrite的错误:[客户127.0.0.1]文件不存在(mod_rewrite error: [client 127.0.0.1] File does not exist)

   IT问题网   2019-08-16 00:00:00

问 题

我要开始使用mod_rewrite这样我就可以在未来使用友好的url。即时通讯在我的本地开发测试所有。环境,但我不是任何运气得到模块的工作!

我的模块已启用(apache的重新启动):

 的loadmodule rewrite_module模块/ mod_rewrite.so
 

在我的apache安装目录下的模块文件夹中存在一个名为mod_rewrite.so文件

我建立在c名为.htaccess的文件:/的public_html /

有关测试的目的,香港专业教育学院建立了我的第一个规则,像这样:

rewriteengine叙述上
#我的翻译,product.html到/product.phpid=123
重写规则^我的产品\ html的$ /product.phpid=123
 

有关测试的目的,product.php是非常简单的:

  php
//显示产品的详细信息
回声"您已经选择的产品#"。 $ _get ['身份证'];
?
 

当我加载 http://localhost/my-product.html 我得到的错误:

 请求的url /my-product.html在此服务器上找到。
 

当我去查看日志,我看到:

[周四9月22日2时37分49秒2011] [错误] [客户127.0.0.1]文件不存在:c:/public_html/my-product.html
 

它看起来像它不承认的.htaccess规则可言!

我不知道下一步该怎么做,我觉得我已经应用了所有simpliest规则开始使用mod_rewrite的,但没有运气!

帮助!

谢谢 马可

解决方案

你改变在httpd.conf文件中的allowoverride属性设置为"所有"。

要检查您的服务器国防部重写是否启用,加载的phpinfo文件,然后搜索mod_rewrite的扩展。

标签:错误过错毛病谬误客户文件不存在



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

重写全球htpasswd的密码保护(Overriding global htpasswd password protection)

problem i am testing a drupal site on a development serve ...

PHP路径包含文件(PHP Path to Include Files)

problem i have a site with an index.php. the index.php ha ...

重写URL隐藏的index.php并作出查询不错(Rewriting url to hide index.php and to make query nice)

problem i had developed project with custom mvc architect ...

htaccess的URL路由的PHP MVC?(htaccess URL routing for PHP MVC)

problem i've been searching and have yet to find an artic ...

的.htaccess规则相应的HTTP链接,HTTP和HTTPS重定向到HTTPS?(.Htaccess rules to redirect respective HTTP links to HTTP and HTTPS to HTTPS)

problem first, here's the .htaccess rule i cu ...

使用的.htaccess追加html的URL路径的背后(using .htaccess to append .html behind url path)

problem people are coming into my website like this: sit ...

的.htaccess迫使对SSL错误页面(.htaccess forcing error pages on SSL)

problem i have the following piece of code in ...

可变301重定向URL(301 redirect URL with variable)

problem i want to use htaccess to 301 redirect (not rewri ...

htaccess的重定向example.com/index.php到example.com/home~~V(htaccess redirect example.com/index.php to example.com/home)

problem thanks in advance, i am trying to redirect anyone ...

htaccess的重写规则问题(.htaccess Rewrite Rule Problems)

problem can anyone help me with htaccess rewr ...

htaccess的子域名与所有的变量文件参数(.htaccess sub domain as file parameter with all the variables)

problem i want to make this url redirect usin ...

字preSS定制的mod_rewrite - totalnoob?(Wordpress custom mod_rewrite - totalnoob)

problem i'm trying to make a custom mod_rewrite rule for ...

我怎样才能让我的网址,从这个例子中友好吗?(How can I make my urls friendly from this example)

problem my site currently displays like this (when clicki ...

htaccess的问题强制SSL(.htaccess issue to force SSL)

problem i activated ssl on one of my sites (based on word ...

IfModule不会出现是工作?(IfModule doesn't appear to be working)

problem if i use this: lt;ifmodule mod_rewrite.cgt; rewr ...

我怎样才能利用外界信息的URL重写?(How can I get use outside information in url rewrites)

problem hopefully some of you .htaccess gurus can help me ...

基于URL到一个新的页面的RewriteCond重写规则进行的.htaccess,定期EX pression(RewriteCond RewriteRule for .htaccess based on URL to a new page, regular expression)

problem i have an interesting rewriterule and i am not su ...

的.htaccess,mod_rewrite的,正则表达式用目录和文件类型(.htaccess, mod_rewrite, regex with directory and filetype)

problem i want to do a rewrite with the following conditi ...

.htaccess的语言重定向310错误(Htaccess language Redirect 310 error)

problem i have a two language site swedish sidewww.site ...

重定向一切的index.php(Redirection everything to index.php)

problem i wan't to redirect everything to index.php exepe ...