Welcome Guest, Not a member yet? Register   Sign In
how do I run ci4 app inside a subfolder of wordpress
#1
Sad 

Lately, I have been trying to run a ci4 project inside a subfolder of the WordPress project, but so far no luck might be because I don't have a vast knowledge of htacess files.
htacess of WordPress projects 
Code:
# HTTPS forced by SG-Optimizer
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END HTTPS
# 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 htacess of the ci4 project to hit the public folder
Code:
RewriteEngine on

RewriteCond $1 !^(index\.php|images|assets|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./public/index.php/$1 [L,QSA]

I would really appreciate any help I get from you guys.
Thanks in advance, happy coding Heart
Learning Codeigniter 
Reply
#2

(This post was last modified: 02-25-2023, 12:49 AM by luckmoshy.)

use this
Code:
RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteCond %{THE_REQUEST} /wordpres/folder/([^\s?]*) [NC]
  RewriteRule ^ %1 [L,NE,R=302]
  RewriteRule ^((?!wordpres/folder/).*)$ wordpres/folder/$1 [L,NC]
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply
#3

(02-25-2023, 12:47 AM)luckmoshy Wrote: use this
Code:
RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteCond %{THE_REQUEST} /wordpres/folder/([^\s?]*) [NC]
  RewriteRule ^ %1 [L,NE,R=302]
  RewriteRule ^((?!wordpres/folder/).*)$ wordpres/folder/$1 [L,NC]

is it for CI or WordPress?
Learning Codeigniter 
Reply
#4

(This post was last modified: 02-25-2023, 10:10 AM by luckmoshy.)

(02-25-2023, 01:00 AM)SubrataJ Wrote:
(02-25-2023, 12:47 AM)luckmoshy Wrote: use this
Code:
RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteCond %{THE_REQUEST} /wordpres/folder/([^\s?]*) [NC]
  RewriteRule ^ %1 [L,NE,R=302]
  RewriteRule ^((?!wordpres/folder/).*)$ wordpres/folder/$1 [L,NC]

is it for CI or WordPress?

This is for the folder where you want to point so this .htaccess help you find your folder where you want to..eg wordpress/folder/

because I don't know how you figure out your app basically you put in a root in WordPress to point your subfolder

so wrdpress/folder/ these are two directors it is you to decide either WordPress or plus folder =wordpress/folder/ change as you wish so just modify to use from WordPress to yours folder

for example here you can hide a public folder in CI4 by using this in a CI root

Code:
RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
  RewriteRule ^ %1 [L,NE,R=302]
  RewriteRule ^((?!public/).*)$ public/$1 [L,NC]

[/quote]
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply




Theme © iAndrew 2016 - Forum software by © MyBB