如果我理解正确,我需要在 httpd.config 中放一些东西来启用 mod_rewrite.如果这是真的,我需要在 httpd.conf 或 apache.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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Zend 中的动作视图助手 - 解决方法?Action View Helper in Zend - Work around?(Zend 中的动作视图助手 - 解决方法?)
这是将 URI 与 PHP 中用于 MVC 的类/方法匹配的好方Is this a good way to match URI to class/method in PHP for MVC(这是将 URI 与 PHP 中用于 MVC 的类/方法匹配的好方法吗)
我在哪里保存 Zend Framework 中的部分(视图),以便Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?(我在哪里保存 Zend Framework 中的部分(视图),以
有一个网站的单一入口点.坏的?好的?没问题?Having a single entry point to a website. Bad? Good? Non-issue?(有一个网站的单一入口点.坏的?好的?没问题?)
MVC + 服务层在 Zend 或 PHP 中常见吗?Is MVC + Service Layer common in zend or PHP?(MVC + 服务层在 Zend 或 PHP 中常见吗?)
PHP MVC 方法中的 Hello World 示例Hello World example in MVC approach to PHP(PHP MVC 方法中的 Hello World 示例)