的.htaccess被忽略?不重定向像它应该不重、htaccess

2023-09-02 10:08:08 作者:づ别说再见、

好吧,我试图用兰多(landocms.com),我试图让pretty的网址选项工作。

Okay I'm trying to use Lando (landocms.com) and I'm trying to get the pretty urls option to work.

基本上默认兰多创建类似链接:domain.com/index.php/page。据称,有一种方法,以消除在index.php所以链接成为:do​​main.com/page。我创建了一个.htaccess的指示,但它不能正常工作。

Basically by default Lando creates link like: domain.com/index.php/page. Supposedly, there is a way to remove the index.php so the links become: domain.com/page. I have created an .htaccess as directed, however it does not work.

下面是我使用的.htaccess:

Here is the .htaccess I am using:

<IfModule mod_rewrite.c>
  RewriteCond   %{REQUEST_FILENAME}   !-f 
  RewriteCond   %{REQUEST_FILENAME}   !-d 
  RewriteRule   ^(.*)$                index.php/$1  [L]
</IfModule>

我曾尝试变化,/index.php/,index.php文件的很多? ,还有更多但没有工作。据HostGator的一切都应该罚款。有什么想法吗?我想我要疯了,哈哈。

I have tried alot of variations, /index.php/, index.php? and plenty more but none work. According to HostGator everything should be fine. Any thoughts? I think I'm going crazy haha.

谢谢!

推荐答案

重写的CMS是一个两层的做法。首先,你需要(在这里我提出一个更安全的进行选择)设置你的的.htaccess

Rewriting for a CMS is a two-tier approach. First, you need to set your .htaccess (I have put a safer one here for you):

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .+ index.php [QSA,L]

然后,LandoCMS允许你从生成的地址删除的index.php ,通过打开的管理面板适当的设置方式。请参见此链接了解详情。

Then, LandoCMS allows you to remove the index.php from the generated addresses, by means of turning on the appropriate setting in the administration panel. See this link for more information.

如果在的.htaccess 内容我已经给你不工作,则只需使用该CMS给你的人。

If the .htaccess content I've given you doesn't work, then simply use the one that the CMS has given you.