0

I have installed Codeigniter into a directory called /gym_management_system inside my Wordpress directory. If I visit www.mydomain.com/v2/gym_management_system I can see my default controller/view, which is a login page, however if I try to login I get a 'Access Denied' in the console for www.mydomain.com/v2/gym_management_system/index.php/User_authentication/user_login_process.

Here's my Wordpress .htaccess

# BEGIN rlrssslReallySimpleSSL rsssl_version[5.2.1]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

And my Codeigniter .htaccess file on public_html/v2/gym_management_system/application

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|assets|images|js|css|uploads|favicon.png|favicon.ico|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>

I did try to access all other controller but it keep show me "Access Denied", before that it was showing "404 error" on wordpress file, but I did try to workaround with .htcaccess however it currently stuck at the "Access Denied" when I try to login.

enter image description here

Please correct me if my .htcaccess was incorrect or any other setting I had to configure on Codeigniter / Wordpress

Thanks alot mate!

Marcus
  • 113
  • 1
  • 3
  • 13
  • why don't you use different domain for different project? – Doelmi Aug 09 '22 at 03:21
  • @Doelmi It was a same website just that some function i would like to create in codeigniter – Marcus Aug 09 '22 at 03:31
  • you can check https://stackoverflow.com/questions/25479350/how-to-run-codeigniterhmvc-inside-wordpress-folder or https://stackoverflow.com/questions/17829990/codeigniter-wordpress-integration – Doelmi Aug 09 '22 at 07:40

0 Answers0