Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 978
Sultan Mahmud Avatar asked May 19 '26 19:05

Sultan Mahmud


1 Answers

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
like image 76
anubhava Avatar answered May 21 '26 12:05

anubhava



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!