0

I'm new to .htaccess. I have two CodeIgniter Project.

I have structured my project like this

parent-folder
--frontend (my frontend codeigniter project)
--backend (my backend codeigniter project)

when I hit example.com it should go to frontend and when I hit example.com/admin it should go to backend.

I'm not getting how to implement using .htaccess.

3
  • possible duplicate of 2 codeigniter applications & htaccess Commented May 15, 2015 at 7:23
  • Are you using CI 3 HMVC Commented May 15, 2015 at 7:27
  • @Uchiha Yes, I'm using CI 3 Commented May 15, 2015 at 7:38

2 Answers 2

1

try this

parent-folder(your frontend codeigniter project)
--admin (your backend codeigniter project)

your front end CI project must be in the root folder and the admin directory must be inside the root folder it need two separate .htaccess files. All files and folders inside frontend folder must be transferred to the parent-folder.

like this:

parent-folder
--.htaccess(.htaccess for your frontend)
--admin
----.htaccess(.htaccess for you admin)

just make sure to specify your admin .htaccess file that youre are in the admin folder in the RewriteBase.

parent-folder:

RewriteBase /

admin

 RewriteBase /admin

:)

Sign up to request clarification or add additional context in comments.

Comments

0

As Vien Mar has given the answer.

I figured out that if you keep the directory structure as

parent-folder(your frontend codeigniter project)
 --admin (your backend codeigniter project)

You can get the project running without extra effort. No need of .htaccess file as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.