我的重写.htaceess文件不起作用 [英] my rewrite .htaceess file not working

查看:88
本文介绍了我的重写.htaceess文件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试为我的网站应用url重写代码,.htaccess文件包含波纹管代码,但它不起作用也没有错误,你能建议一些解决方案吗?



我的代码



RewriteEngine On#打开重写引擎

RewriteRule ^ products /([0 -9] +)/?$ index.php?product_id = $ 1 [NC,L]






谢谢,

I try to apply url rewrite code for my web site, .htaccess file include bellow code, but it is not working and no errors also,can you suggest some solution for that?

my code

RewriteEngine On # Turn on the rewriting engine
RewriteRule ^products/([0-9]+)/?$ index.php?product_id=$1 [NC,L]



Thank you,

推荐答案

index.php?product_id =
index.php?product_id=


1 [NC,L]





谢谢,
1 [NC,L]


Thank you,


也许没有启用mod_rewrite。

Perhaps mod_rewrite is not enabled.
"The mod_rewrite by default is disabled in Apache servers to prevent any chance of misuse. The module can, however, be switched on through certain commands listed in the httpd.conf file. This file can be found in a folder, which by default, is named ‘configuration’, or something similar."



http://www.serverschool.com/server-configuration/how-to-enable-mod_rewrite-in-apache- server / [ ^ ]



问题也可能与您的操作系统有关。如果你使用的是Windows,这个链接可能会有所帮助。



http://www.snippetit.com/2008/04/enable-htaccess-and-url-rewriting-in-apache-http- server-for-windows / [ ^ ]


这篇关于我的重写.htaceess文件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆