如何在任何操作系统上启用mod_rewrite? [英] How do you enable mod_rewrite on any OS?

查看:78
本文介绍了如何在任何操作系统上启用mod_rewrite?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我理解正确,则需要在httpd.config中添加一些内容以启用mod_rewrite.如果是这样,我需要在httpd.confapache.conf中放入什么?请特定于操作系统.

If I understand correctly, I need to put something in httpd.config to enable mod_rewrite. If this is true, what do I need to put in httpd.conf or apache.conf? Please be OS specific.

推荐答案

不是,mod_rewrite是Apache模块,与PHP无关.

Nope, mod_rewrite is an Apache module and has nothing to do with PHP.

要激活模块,必须激活httpd.conf中的以下行:

To activate the module, the following line in httpd.conf needs to be active:

LoadModule rewrite_module modules/mod_rewrite.so

要查看它是否已处于活动状态,请尝试将.htaccess文件放入包含该行的Web目录中

to see whether it is already active, try putting a .htaccess file into a web directory containing the line

RewriteEngine on

如果在不引发500个内部服务器错误的情况下仍然有效,并且.htaccess文件被解析,则URL重写有效.

if this works without throwing a 500 internal server error, and the .htaccess file gets parsed, URL rewriting works.

这篇关于如何在任何操作系统上启用mod_rewrite?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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