[SOLVED] Getting Rid of index.php/
[SOLVED] Getting Rid of index.php/
Hello. I was wondering if I might have some expert minds help me out on my issue of clean url's.
Currently, for any directory, such as http://mydomainname.com/index.php/home or http://mydomainname.com/index.php/about, I'm getting the annoying "index.php/" put in between the domain name and the alias for the folder name. The only other topic dealing with this same issue had someone that had unique settings in their mod-rewrite server file (or something like that), so I wasn't able to gain anything from there.
My .htaccess and config.php files are set according to the instructions listed in cmsmadesimple.org and in various forum entries, as seen below, along with the {metadata} tag in all my templates.
My .htaccess file on the root folder reads as follows:
______________
#Config for CMS
RewriteEngine On
Rewrite Base /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
___________________
My config.php file reads as follows:
___________________
#------------
#URL Settings
#------------
#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = true;
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';
#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism? This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
_________________________
Any ideas as to what might be happening and what would be my next step? Really appreciate the help!!
Rob
Currently, for any directory, such as http://mydomainname.com/index.php/home or http://mydomainname.com/index.php/about, I'm getting the annoying "index.php/" put in between the domain name and the alias for the folder name. The only other topic dealing with this same issue had someone that had unique settings in their mod-rewrite server file (or something like that), so I wasn't able to gain anything from there.
My .htaccess and config.php files are set according to the instructions listed in cmsmadesimple.org and in various forum entries, as seen below, along with the {metadata} tag in all my templates.
My .htaccess file on the root folder reads as follows:
______________
#Config for CMS
RewriteEngine On
Rewrite Base /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
___________________
My config.php file reads as follows:
___________________
#------------
#URL Settings
#------------
#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = true;
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';
#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism? This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
_________________________
Any ideas as to what might be happening and what would be my next step? Really appreciate the help!!
Rob
Last edited by rfuste on Fri Feb 01, 2013 7:29 pm, edited 1 time in total.
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: Getting Rid of index.php/
Hmm.. It looks like your .htaccess file is the same as the one listed on http://wiki.cmsmadesimple.org/index.php ... retty_URLs except for the:
Maybe if you try removing the:Rewrite Base /
it might work. I don't use that line on my website that uses clean URLs.Rewrite Base /
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: Getting Rid of index.php/
Thank you, Elijah, for the reply and help!
Unfortunately, I removed it and it still does the same thing. Any other ideas? Anyone else out there that have feedback? Appreciate the help!!
Rob
Unfortunately, I removed it and it still does the same thing. Any other ideas? Anyone else out there that have feedback? Appreciate the help!!
Rob
Re: Getting Rid of index.php/
Set all the options in the clean urls section of the config.php to true and see what happens.
Re: Getting Rid of index.php/
Thanks for the reply, Kayin.
Again, setting them all to true doesn't seem to fix the issue... hmmm...
Thanks anyway.
)
Again, setting them all to true doesn't seem to fix the issue... hmmm...
Thanks anyway.

Re: Getting Rid of index.php/
have you talked to your host to see if they have restrictions on .htaccess...
Re: Getting Rid of index.php/
Mark,
Thank you! Yes, indeed, my mac was causing the conflict, since it was rewriting the .htaccess with a bunch of extra code, even though I was using plain text editor. So using the pc, it now works!!
One more question, though: I still see the "index.php" thing in the middle of the URL when I scroll over my top menu items on the homepage (comebestill.org). What else might I be missing?
Thanks for the help already!
Rob
Thank you! Yes, indeed, my mac was causing the conflict, since it was rewriting the .htaccess with a bunch of extra code, even though I was using plain text editor. So using the pc, it now works!!
One more question, though: I still see the "index.php" thing in the middle of the URL when I scroll over my top menu items on the homepage (comebestill.org). What else might I be missing?
Thanks for the help already!

Rob
Re: Getting Rid of index.php/
check your base url.
Re: Getting Rid of index.php/
I've checked the .htaccess and it reads:
RewriteBase /
Is this what you mean? I also have a tag in the template of
Could the issue be somewhere in the menu module? Or is it primarily with the .htaccess and config.php files?
Thanks for all the help!
Rob
RewriteBase /
Is this what you mean? I also have a tag in the template of
Could the issue be somewhere in the menu module? Or is it primarily with the .htaccess and config.php files?
Thanks for all the help!
Rob
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: Getting Rid of index.php/
Double check config.php to make sure this is set:rfuste wrote: One more question, though: I still see the "index.php" thing in the middle of the URL when I scroll over my top menu items on the homepage (comebestill.org). What else might I be missing?
Code: Select all
#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = true;
Hope this helps.

Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: Getting Rid of index.php/
Elijah,
Thanks for the help. It made me realize that I also had a config.php that wasn't being refreshed when I would make changes to it. So in my .htaccess file, I've tried with both RewriteBase / and without it, with no success. With the config.php, I've tried it with all of them set to true, with all set to true except for the internal pretty URL's one, and no success. Lastly, I also clear the site cache. After several variations here and there, I just can't make out what might be going on - I must be stupid or something.
Anyway, at least I can directly type in pretty URL's, such as comebestill.org/about and it works fine. It's just when I start clicking on the menu that it's starts adding the index.php in the middle of it. Oh well, my patience level must be low this particular afternoon.
) If anyone has ideas, I'd gladly welcome them.
Thanks for all the help!
Rob
Thanks for the help. It made me realize that I also had a config.php that wasn't being refreshed when I would make changes to it. So in my .htaccess file, I've tried with both RewriteBase / and without it, with no success. With the config.php, I've tried it with all of them set to true, with all set to true except for the internal pretty URL's one, and no success. Lastly, I also clear the site cache. After several variations here and there, I just can't make out what might be going on - I must be stupid or something.
Anyway, at least I can directly type in pretty URL's, such as comebestill.org/about and it works fine. It's just when I start clicking on the menu that it's starts adding the index.php in the middle of it. Oh well, my patience level must be low this particular afternoon.

Thanks for all the help!
Rob
Re: Getting Rid of index.php/
Add this $config['url_rewriting'] = 'mod_rewrite';
you probably have this:
$config['url_rewriting'] = 'internal';
you probably have this:
$config['url_rewriting'] = 'internal';