在 Ubuntu 中启用 mod_rewrite 时出现问题

发布于 2024-09-04 06:22:47 字数 254 浏览 1 评论 0原文

我正在尝试从Windows服务器更改为Linux服务器。为此,我尝试在 ubuntu 中启用 mod_write 。我已采取所有必要的步骤来启用 mod_rewrite,因为 mod_rewrite 显示在加载的模块下。我已经设置了 .htacess 文件的所有权限。但由于某种原因,重写似乎在 Linux 服务器上不起作用。当我在 Windows 服务器中使用相同的代码时,它工作正常。

任何人都可以帮助我解决这个问题。我们将非常感谢您的帮助。

谢谢。 拉詹。

I am trying to change from windows to linux server. And for that i am trying to enable mod_write in ubuntu. I have taken all the necessary steps to enable the mod_rewrite as mod_rewrite is displayed under loaded modules. I have set all the permissions for the .htacess file. But for some reason the rewrite does not appear to be working in the linux server. It was working fine while i was using the same code in windows server.

Can anyone please help me in this issue. Your help will be really appreciated.

Thanks.
Rajan.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

始终不够爱げ你 2024-09-11 06:22:47

检查您是否将 AllowOverride 指令设置为 None。这通常是在设置 VirtualHosts 的文件中完成的

NameVirtualHost 192.168.0.1:80
<VirtualHost 192.168.0.1:80>
    ServerName some.local.site

    DocumentRoot /home/user/site
    <Directory /home/user/site>
            AllowOverride None  <-- set this to All

    </Directory>
</VirtualHost>

Check if you have the AllowOverride directive set to None. This is usually done in a file which sets your VirtualHosts

NameVirtualHost 192.168.0.1:80
<VirtualHost 192.168.0.1:80>
    ServerName some.local.site

    DocumentRoot /home/user/site
    <Directory /home/user/site>
            AllowOverride None  <-- set this to All

    </Directory>
</VirtualHost>
初见终念 2024-09-11 06:22:47

如果将 AllowOverride 设置为 ALL 不起作用,您可能需要像这样调试 mod_rewrite:

RewriteEngine On 之后添加

RewriteLog "/var/log/httpd/mod_rw.log"
RewriteLogLevel 9

If setting AllowOverride to ALL didn't work, you might want to debug mod_rewrite like so:

add after RewriteEngine On

RewriteLog "/var/log/httpd/mod_rw.log"
RewriteLogLevel 9
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文