• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to run version 4 in a subdirectory

#1
I've searched for hours and found lots of suggestions, of which none worked because they all seem to be too old and don't address version 4's move of index.php to public.

Here's what I finally ended up with before I came here.  This is in my edit directory (http://example.com/edit.  I'm running it in a virtual system managed by virtualmin and the files are in ~/public_html.  Specifically ~/public_html/edit. 
Code:
~/public_html/edit$ ls -a
.   .gitignore  README.md  composer.json  license.txt       public  system
..  .htaccess   app        env            phpunit.xml.dist  spark   writable
Code:
Options +SymLinksifOwnerMatch

# RewriteEngine On
# Please do-not forget to change RewriteBase /YOUR-SUBFOLDER HERE
RewriteBase /edit

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

RewriteRule ^(.*)$ public/index.php?/$1 [L]
I don't quite understand Apache directives.  This gets me to a 404 error when I visit http://example.com/edit

I know it can be done, I just can't do it.
Thanks for the help.
Jim.

I did change the public/.htaccess file too:
RewriteBase /edit
Reply

#2
Hi, take a look at this tutorial:
https://forum.codeigniter.com/thread-76777.html

And instead of /public_html/ it should be /public_html/edit

And you need ../../ instead of ../ in your index.php file.

If it dosen't work, open up your .htaccess and only change "RewriteBase /edit", everything else should be left as is.
Reply

#3
That works or at least it displays something reasonable. Now I just have to develop the site.

Thank you!
Jim.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.