【问题标题】:Codeigniter htaccess issue with wordpresswordpress 的 Codeigniter htaccess 问题
【发布时间】:2017-02-24 15:13:31
【问题描述】:

我面临一个问题,虽然有很多答案,但似乎没有一个有效。

我有一个安装了 wordpress 的主机。 在其中我创建了一个文件夹并安装了 codeigniter。 不知何故,我设法从 url 中删除了 index.php,但是 iscaffold 中的 css 和其他文件不起作用。

这是 .htaccess 文件。

根:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule>
# END WordPress

子文件夹:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /lastwish
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

网址: http://epf-india.co.in.md-in-23.webhostbox.net/lastwish/login

您可以查看源代码并查看正在重定向的 css 和 js 文件。

谢谢

【问题讨论】:

  • 尝试更改RewriteBase /lastwish/与最终/
  • 这样做会将其重定向到主站点:epf-india.co.in

标签: wordpress .htaccess codeigniter


【解决方案1】:

添加标题 css 链接。 喜欢

<link rel="stylesheet" href="<?php echo base_url();?>iscaffold/backend_skins/stylesheets/themes/default/style.css" type="text/css" media="screen" />

【讨论】:

  • 问题是别的,文件不能通过直接路径访问
【解决方案2】:

1) WordPress .htaccess

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

2) 代码点火器.htaccess

    RewriteEngine on
    RewriteCond $1 !^(index\.php|resources|robots\.txt)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]

3) 并更改了您的配置文件,即codeigniter/application/config/config.php

        $config['base_url'] = '/codeigniter';
        $config['index_page'] = '';

4) 你的 css 链接就像 - 在 /codeigniter 根资产中创建文件夹 代码点火器 -应用 -资产 -系统 -user_guide

<link rel="stylesheet" href="<?php echo base_url();?>assets/iscaffold/backend_skins/stylesheets/themes/default/style.css" type="text/css" media="screen" />

你会试试这个。

【讨论】:

    猜你喜欢
    • 2011-10-04
    • 1970-01-01
    • 1970-01-01
    • 2012-05-10
    • 1970-01-01
    • 2020-06-18
    • 1970-01-01
    • 2020-12-08
    • 2015-03-06
    相关资源
    最近更新 更多