ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How do I remove the index.php on BlueHost.com/HostMonster.com hosting

March 06, 2010 8:10pm

Subscribe [2]
  • #1 / Mar 06, 2010 8:10pm

    Curtis Scott

    17 posts

    I have a site set up as a sub domain on my HostMonster.com account that I’m trying to remove the index.php from the url. I want visitors to see and go to website.com/about-us/ not website.com/index.php/about-us. I have looked through the wiki and tested many different .htaccess scripts and nothing seems to work for me. I am placing the .htaccess in the root of the sub directory and making the preference change in the admin.

    Does anyone have any expereice with successfully removing this on BlueHost or HostMonster?

    Thanks,
    Curtis

  • #2 / Mar 06, 2010 11:05pm

    Adam Dorsey

    1439 posts

    What happens when you use the .htaccess script? Blank pages, 404, etc?

    I always use:

    RewriteEngine On 
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /index.php/$1 [L]

    Then I remove “index.php” as my sites index page in the CP.

    It may be that you need to force query strings.

  • #3 / Mar 06, 2010 11:15pm

    Curtis Scott

    17 posts

    Thanks for your reply Adam. I tried your code and nothing seems to happen. Also, I made sure - CP Home ›  Admin ›  System Preferences ›  General Configuration > Name of your site’s index page - field is blank and CP Home ›  Admin ›  System Preferences ›  General Configuration > URL to the root directory of your site - field is set to just the url without index.php.

    You can see what happens here:

    http://reefkeeping.puredezigner.com/index.php &

    http://reefkeeping.puredezigner.com/index.php/about-us/

    These work fine but I would like to be able to use http://reefkeeping.puredezigner.com/about-us/ instead.

    You mentioned ‘force query strings’, can you please explain how I can do this? Thanks!

  • #4 / Mar 06, 2010 11:19pm

    Adam Dorsey

    1439 posts

    You can force query strings by going to:
    Admin ›  System Preferences ›  Output and Debugging Preferences

    You may need to introduce something, if your server doesn’t support the PATH_INFO variable (check with your host to be sure.)

    In that case, the best your URL would get is:

    http://reefkeeping.puredezigner.com/?/about-us/ (which works now)

  • #5 / Mar 07, 2010 12:40am

    Curtis Scott

    17 posts

    I got it! You pointed me in the right direction I also needed to do this http://expressionengine.com/wiki/Workaround_for_Forced_Query_Strings/ I got it working. Thank you so much!

  • #6 / Mar 07, 2010 11:26am

    Adam Dorsey

    1439 posts

    Awesome! Glad I could help 😊

  • #7 / Mar 19, 2010 4:06pm

    Curtis Scott

    17 posts

    Now I’m attempting to set this up on BlueHost I’m having issues again. :(

    This install will be set up as the main domain, would the above htaccess code differ any?

    Thanks in advance.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases