[SOLVED] Getting Rid of index.php/

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
rfuste
Forum Members
Forum Members
Posts: 50
Joined: Wed Jun 07, 2006 7:56 pm

[SOLVED] Getting Rid of index.php/

Post by rfuste »

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
Last edited by rfuste on Fri Feb 01, 2013 7:29 pm, edited 1 time in total.
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Getting Rid of index.php/

Post by Elijah Lofgren »

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:
Rewrite Base /
Maybe if you try removing the:
Rewrite Base /
it might work. I don't use that line on my website that uses clean URLs.
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. :)
rfuste
Forum Members
Forum Members
Posts: 50
Joined: Wed Jun 07, 2006 7:56 pm

Re: Getting Rid of index.php/

Post by rfuste »

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
Kayin
Forum Members
Forum Members
Posts: 59
Joined: Mon Jun 05, 2006 2:33 am

Re: Getting Rid of index.php/

Post by Kayin »

Set all the options in the clean urls section of the config.php to true and see what happens.
rfuste
Forum Members
Forum Members
Posts: 50
Joined: Wed Jun 07, 2006 7:56 pm

Re: Getting Rid of index.php/

Post by rfuste »

Thanks for the reply, Kayin.

Again, setting them all to true doesn't seem to fix the issue... hmmm...

Thanks anyway. :o)
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Getting Rid of index.php/

Post by Dr.CSS »

have you talked to your host to see if they have restrictions on .htaccess...
rfuste
Forum Members
Forum Members
Posts: 50
Joined: Wed Jun 07, 2006 7:56 pm

Re: Getting Rid of index.php/

Post by rfuste »

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
Kayin
Forum Members
Forum Members
Posts: 59
Joined: Mon Jun 05, 2006 2:33 am

Re: Getting Rid of index.php/

Post by Kayin »

check your base url.
rfuste
Forum Members
Forum Members
Posts: 50
Joined: Wed Jun 07, 2006 7:56 pm

Re: Getting Rid of index.php/

Post by rfuste »

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
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Getting Rid of index.php/

Post by Elijah Lofgren »

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?
Double check config.php to make sure this is set:

Code: Select all

#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = true;
If that does not work, try clearing your site cache in "Site Admin -> Global Settings". Maybe the site cache is stale.

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. :)
rfuste
Forum Members
Forum Members
Posts: 50
Joined: Wed Jun 07, 2006 7:56 pm

Re: Getting Rid of index.php/

Post by rfuste »

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. :o)  If anyone has ideas, I'd gladly welcome them.

Thanks for all the help!
Rob
mattearle
New Member
New Member
Posts: 2
Joined: Sat Oct 15, 2011 1:36 am

Re: Getting Rid of index.php/

Post by mattearle »

Add this $config['url_rewriting'] = 'mod_rewrite';

you probably have this:

$config['url_rewriting'] = 'internal';
Post Reply

Return to “CMSMS Core”