【问题标题】:I got a stuck with .htaccess and rewrite我被 .htaccess 卡住并重写
【发布时间】:2013-11-01 18:27:39
【问题描述】:

我在 linuxmint 上使用 Lamp 服务器,并在其上安装了 2 个 wordpress 平台,一个名为“bfsite”,另一个名为“titus”。我按照 WordPress 的建议修改了 .htacces 文件

    <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /bfsite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bfsite/index.php [L]
</IfModule>

这个是给bfsite的,我是为/titus平台修改的

   <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /titus/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /titus/index.php [L]
</IfModule>

还有一个简单的重定向。

Redirect /index.php http://89.39.166.81/titus

如你所见,我在网上创建了我的 locahost,让你看看发生了什么,当我尝试继续时

http://89.39.166.81/titus/about

它会返回给我http://localhost/titus/dev/,如果你强制使用这条路径

http://89.39.166.81/titus/dev/

它带有 404 和找不到页面错误,但与“bfsite”wordpress 平台一起使用。

【问题讨论】:

    标签: wordpress .htaccess mod-rewrite lamp


    【解决方案1】:

    因为你使用的是 ubuntu 发行版,所以你可以使用它

    sudo a2enmod rewrite
    

    -- 然后你可以从 wp 后端启用 postname。祝你好运!

    【讨论】:

    • 模块重写已启用 --> 这是我的终端对我的响应,我认为我在 .htaccess 中输入的代码正在产生冲突问候!
    • 哦,是的,删除 .htaccess 中的所有内容,通过终端 sudo gedit .htaccess 进入 bfsite 文件夹并粘贴。对于titus文件夹,将“bfsite”下面的代码中的代码替换为“titus”并重复该过程! RewriteEngine On RewriteBase /bfsite/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule 。 /bfsite/index.php [L]
    • 正在工作!谢谢西普里安
    猜你喜欢
    • 2023-02-09
    • 1970-01-01
    • 2022-01-04
    • 2018-04-22
    • 1970-01-01
    • 2016-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多