Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to remove folder and index.php from URL path
  • I have a .htaccess with rewrite ON how can i remove [url=http://localhost/portfolio/public/index.php/]http://localhost/portfolio/public/index.php/[/url] bold path? this was created by using
    <?php echo Html::anchor(NULL, 'Ínicio'); ?>
    

    my .htaccess:
    <IfModule mod_rewrite.c>
     RewriteEngine on
    
     RewriteBase /portfolio/public
    
     RewriteRule ^(/)?$ index.php/$1 [L]
    
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
    
     RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule>
    

    Thanks
  • on a previous post it said "Either use an .htaccess to rewrite all requests to /public/index.php or just move the files from public to your root and edit the relative paths to your app, core & packages dirs in the index.php." can you please tell me how to do those solutions? which one is the best?
    I want my link 'http://localhost/fuelphp/intranet/public/fr/histoire' looks like 'http://localhost/intranet/fr/histoire'.
    what is 'my root'? which folder are you talking about?
  • In "config/config.php" set 'index_file' configuration to false
  • Davide Bellini wrote on Wednesday 18th of May 2011:
    In "config/config.php" set 'index_file' configuration to false

    thanks, it works. also there are a way to remove 'public' from path?
  • set public as your root directory
  • Either use an .htaccess to rewrite all requests to /public/index.php or just move the files from public to your root and edit the relative paths to your app, core & packages dirs in the index.php.
  • Jelmer Schreuder wrote on Wednesday 18th of May 2011:
    Either use an .htaccess to rewrite all requests to /public/index.php or just move the files from public to your root and edit the relative paths to your app, core & packages dirs in the index.php.

    thanks, solved :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion