• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to remove public/index.php/ from url

#11
Hello Guys !

I ran into this problem too. My point is that I´m running my website on a SHARED HOSTING and I don´t want to mess around...

I just solved this by adding a .htaccess file in root directory:

Code:
DirectoryIndex /public/index.php
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]
Reply

#12
It's very simple:

- keep the original .htaccess from the public folder

- copy .htacccess and index.php from public folder to the root of your project;

- edit the index.php and change the line below...

$pathsPath = FCPATH . '../app/Config/Paths.php';

to...

$pathsPath = FCPATH . 'app/Config/Paths.php';

That's it!
Reply

#13
Based on your issue. I had the same problem look. I created two .htaccess file one at the public folder and the other at the root directory but no success so.
This is how I solved my own problem =>
I move the default .htaccess and the index.php files in the public directory to the root directory then I edit the index file to point to the app directory just like the code below
PHP Code:
// Location of the Paths config file.
// This is the line that might need to be changed, depending on your folder structure.
$pathsPath FCPATH '../app/Config/Paths.php';
// ^^^ Change this if you move your application folder 
to this below
PHP Code:
// Location of the Paths config file.
// This is the line that might need to be changed, depending on your folder structure.
$pathsPath FCPATH './app/Config/Paths.php';
// ^^^ Change this if you move your application folder 
I hope this will help you and others who are also facing the same issue
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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