简体   繁体   中英

Different project on Wordpress sub directory

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM