Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Prevent URI::create() from Including index.php File
  • I have set up my config file to not use the index file, as well as set up the htaccess file with mod_rewrite, as included with the FuelPHP download. However, I can not get the index.php portion of the URL to go away. I am using MAMP with a custom subdomain setup as follows:
    <VirtualHost *:80>
    DocumentRoot "/Applications/MAMP/htdocs/dev/personalprojects/"
    <Directory "/Applications/MAMP/htdocs/dev/personalprojects/">
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all
    I don't believe there is anything wrong with my subdomain code above, as I have always used it and it has worked fine. Does anyone have any pointers? I know that I can use URI::base(false) to stripe index.php from the url, but like I mentioned about, I can't do such was URI::create(). Any help would be greatly appreciated.
  • If you call Uri::create() with no parameters, it will use the current request URI to create the URI. If that contains "index.php", so will the result. If this is the case, you should see the "index.php" in your browser as well, which would indicate that your rewriting doesn't work. If you call it with parameters, the 'index_file' key in the config file will determine whether it is included or not.

Howdy, Stranger!

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

In this Discussion