htaccess重写问题

发布于 2024-09-29 06:41:13 字数 369 浏览 1 评论 0原文

我想将网址 http://mydomain/myapp/fakefolder 重写为 http://mydomain/myapp/index.php

我尝试了以下规则,但那不起作用

RewriteEngine On
RewriteRule ^fakefolder$ index.php  

.htaccess 文件位于 myapp 内部。

请帮忙

谢谢 维内特

I want to rewrite the url http://mydomain/myapp/fakefolder to http://mydomain/myapp/index.php

I tried the following rule but thats not working

RewriteEngine On
RewriteRule ^fakefolder$ index.php  

The .htaccess file is located inside myapp.

Kindly help

Thanks
vineet

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

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

发布评论

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

评论(1

£冰雨忧蓝° 2024-10-06 06:41:13

首先,您的文件夹不名为 vinetstore:它名为 fakefolder


更正后的规则适用于我,所以我敢说您的 Apache 安装未配置为读取此类位置中的 .htaccess 文件。您可以轻松地进行测试:故意犯一个语法错误,然后查看您的网站是否崩溃。

找到您的虚拟主机或站点定义并确保您有此指令:

AllowOverride All

To begin with, your folder is not called vineetstore: it's called fakefolder.


The corrected rule works for me so I'd dare say your Apache installation is not configured to read .htaccess files in such location. You can easily test that: make a syntax error on purpose and see whether your site crashes.

Find your virtual host or site definition and make sure you have this directive:

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