Different project on Wordpress sub directory

2019-05-10 00:16发布

I am trying to develope a project on a sub directory of my web root where WordPress is installed. Somehow it keeps showing 404 error page. Let me explain -

http://www.mysite.com - [Web root directory/WordPress site installed]

.htaccess of this directory:

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

http://www.mysite.com/crm/ - [New directory 'crm' where I stored my CodeIgniter project/Secured pages]

.htaccess of this crm directory: (this is for Codeigniter project)

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

Whenever I try to access the second link, it shows 404 error. Please help me to solve this issue.

** If I use normal html file, it works, but for secured page, it does not work.

1条回答
做个烂人
2楼-- · 2019-05-10 00:57

You need to change your /crm/.htaccess as:

RewriteEngine on
RewriteBase /crm/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

And DocumentRoot/.htaccess as this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^crm(/|$) - [NC,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
查看更多
登录 后发表回答