Memorial Day
Support will be closed on Monday, May 28th, 2012 to enjoy Memorial Day with our friends and families.
This thread is a discussion for the wiki article: Remove index.php From URLs
   
2 of 4
2
Remove index.php From URLs
Posted: 06 November 2008 07:11 PM   [ Ignore ]   [ # 19 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2544
Joined  02-28-2008

Perhaps a bug from extension smile although manually removing the pipe didn’t fix it.

I’m guessing this is because you don’t have any pages in your site.

LOL, no seriously…has anyone tried the extension or reported issues.
In any case, thanks for the work!

 Signature 

Defeat is a state of mind; no one is ever defeated until defeat has been accepted as a reality.

Profile
 
 
Posted: 06 November 2008 08:08 PM   [ Ignore ]   [ # 20 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1336
Joined  01-24-2006

All the extension does is replace the {ee:} tags with your pages and templates. The default settings are only a guide and will change from site to site.

More support can be found here: http://expressionengine.com/forums/viewthread/90365/

The first thing I suggest is to get the “include method” working without the extension and then use your .htaccess as a base for the extension settings

 Signature 

EE-Garage.com - All my ExpressionEngine 2 Addons!


EE2 - NSM Better Meta - SEO Meta & XML Sitemap Generator
EE2 - NSM Live Look - Real entry previews


Newism - Newcastle - ExpressionEngine Experts

Profile
 
 
Posted: 06 November 2008 08:57 PM   [ Ignore ]   [ # 21 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2544
Joined  02-28-2008

Thanks Leevi for the follow up.
The “include method” does work so it must be the extra options in extension.I will browse the thread.
Thanks again!

 Signature 

Defeat is a state of mind; no one is ever defeated until defeat has been accepted as a reality.

Profile
 
 
Posted: 12 November 2008 02:44 PM   [ Ignore ]   [ # 22 ]  
Summer Student
Total Posts:  24
Joined  11-12-2008

Hi all.

Followed both the EE doc on how to remove the index.php and also tried this one:
http://www.wil-linssen.com/expression-engine-removing-indexphp/

Both removed the index.php fine but when I try to go my post or any page, I get taken to my localhost page (in this case it is XAMPP).

Is there something else I need to do on my localhost to have to do to get this working?

I know it’s only my localhost but it’s rather annoying me cheese

Profile
 
 
Posted: 17 December 2008 09:54 AM   [ Ignore ]   [ # 23 ]  
Summer Student
Avatar
Total Posts:  6
Joined  11-12-2008

This really should be handled by the EE admin. It is nuts that we have to go in and do these hacks to make the URL strings more usable. Are there plans to include this in the Admin of a coming release?

Profile
 
 
Posted: 17 December 2008 12:44 PM   [ Ignore ]   [ # 24 ]  
Summer Student
Avatar
Total Posts:  6
Joined  11-12-2008

or better yet, EE should remove index.php from the URL by default. Is there even anyone who uses EE that prefers to have index.php in the middle of the URL?

Profile
 
 
Posted: 17 December 2008 12:51 PM   [ Ignore ]   [ # 25 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  13771
Joined  04-15-2006

I for one love taking out the index.php bit as I just like my URLs to be that little bit shorter wherever possible. Having said this though this is not something that ExpressionEngine will probably ever do as standard and definitely not something that I think the developers would ever support.

The problem is that whilst on most servers it is a pretty simple thing to do there are a few different server environments that make it slightly more difficult to get to work and whilst this is definitely something which is a server environment issue and not directly related to ExpressionEngine then I feel the developers have taken the correct path here on this one.

If your host can’t help you get this set up properly then I for one don’t really see why the ExpressionEngine developers should have to? That said they do help out with these kinds of requests all the time but do let you know that it isn’t supported. The point here being that ExpressionEngine works fine with index.php in the URL and as this is a server environment setting then I doubt it will ever be supported directly.

I’m sure one of the developers will be able to pop in on this one though and flesh out what I have said but really this is akin to saying that because ExpressionEngine can spit out images in my template then the developers should help me get my images looking really professional wink

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

Profile
 
 
Posted: 17 December 2008 02:09 PM   [ Ignore ]   [ # 26 ]  
Summer Student
Avatar
Total Posts:  6
Joined  11-12-2008

That all makes sense what you say, but there are prominent open source solutions out there which use the same sever environment (i am only familiar first hand with Drupal, Zenphoto, and Wordpress) and have no problem with modifying how URL’s are generated.

Profile
 
 
Posted: 01 January 2009 09:03 PM   [ Ignore ]   [ # 27 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  05-08-2003

omg!! this did the trick for me!! thank you!!! I’ve been struggling with this for months also and now it is working!

spindigg - 09 August 2008 02:45 PM

Using the default recommended rewrite rules using .htaccess on Apache didn’t work for me. I found a forum post with the following recommendations which did the trick.

Try changing this line

RewriteRule ^(.*)$ /index.php/$1 [L] 

to:

RewriteRule ^(.*)$ /index.php?/$1 [L] 

(note the ? after index.php)

 Signature 

version: 1.7.1
build:  20110520

Profile
 
 
Posted: 09 January 2009 03:43 PM   [ Ignore ]   [ # 28 ]  
Grad Student
Rank
Total Posts:  39
Joined  08-02-2007

First, I think it’s silly that a $250 CMS like EE doesn’t actually have the native ability to remove the /index.php/ in there. That’s just dumb. Sorry, but it is. I can’t think of one other CMS with that issue, and most of the ones I’m thinking of are free and open source.

Second, the wiki page is wrong, and doesn’t seem to work for anyone. Plenty of fixes have been suggested in these comments, which DO work for me. However, since I haven’t quite posted 100 messages yet, I cannot edit the wiki page. This also is frustrating.

Can someone with permission simply edit the wiki page to mention that you want a ? after index.php or it won’t work for most folks?!?

Thank you.

Profile
 
 
Posted: 09 January 2009 04:01 PM   [ Ignore ]   [ # 29 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  26092
Joined  05-14-2004

Hi, Raymond,

I am sorry that you are frustrated, but $0, $250, or $250,000 - this is a server-side change.  I know that some of the open source systems *include* the .htaccess with their distribution; that doesn’t make it any less of a server-side trick.

Many more people use those wiki tricks with no problems - remember, people without problems don’t post to support forums; what you see here is the subset of people that need assistance, it is not representative of the entire community.  Furthermore - the wiki has no 100 post limit; that is only for the comments on the documentation. So you can, indeed, change the wiki article if appropriate.

Thank you again for your feedback and I hope you did manage to get this working after all.

 Signature 
Profile
MSG
 
 
Posted: 14 April 2009 11:47 AM   [ Ignore ]   [ # 30 ]  
Summer Student
Total Posts:  14
Joined  03-26-2009

I’m having a problem using the include method. My template groups contain dashes (-) and thus the rewrite rules aren’t being properly applied to them. For example:

RewriteCond %{REQUEST_URI} ^/(site|search|our-team|current-searches|our-process|our-team|proven-success|current-searches|about-us|members|P[0-9]{2,8}[NC] 

In this case www.site.com/index.php/site/article changes to www.site.com/site/article

however,

www.site.com/index.php/our-process/article does not change.

I’ve tried adding an escape in front of the dashes in the .htaccess file but to no avail.

Has anyone had luck dealing with this issue?

Profile
 
 
Posted: 29 April 2009 04:32 AM   [ Ignore ]   [ # 31 ]  
Grad Student
Rank
Total Posts:  71
Joined  11-19-2004

Did you ever get this worked out? I don’t seem to be having the same problem with dashes in my RewriteCond. Maybe try replacing the dashes with dots (single char)?

idfive - 14 April 2009 03:47 PM

I’m having a problem using the include method. My template groups contain dashes (-) and thus the rewrite rules aren’t being properly applied to them. For example:

RewriteCond %{REQUEST_URI} ^/(site|search|our-team|current-searches|our-process|our-team|proven-success|current-searches|about-us|members|P[0-9]{2,8}[NC] 

In this case www.site.com/index.php/site/article changes to www.site.com/site/article

however,

www.site.com/index.php/our-process/article does not change.

I’ve tried adding an escape in front of the dashes in the .htaccess file but to no avail.

Has anyone had luck dealing with this issue?

Profile
 
 
Posted: 08 May 2009 01:15 PM   [ Ignore ]   [ # 32 ]  
Summer Student
Total Posts:  9
Joined  08-07-2005
idfive - 14 April 2009 03:47 PM

I’m having a problem using the include method. My template groups contain dashes (-) and thus the rewrite rules aren’t being properly applied to them. For example:

RewriteCond %{REQUEST_URI} ^/(site|search|our-team|current-searches|our-process|our-team|proven-success|current-searches|about-us|members|P[0-9]{2,8}[NC] 

In this case www.site.com/index.php/site/article changes to www.site.com/site/article

however,

www.site.com/index.php/our-process/article does not change.

I’ve tried adding an escape in front of the dashes in the .htaccess file but to no avail.

Has anyone had luck dealing with this issue?

Try escaping your dashes like this:

RewriteCond %{REQUEST_URI} ^/(site|search|our\-team|current\-searches|our\-process|our\-team|proven\-success|current\-searches|about\-us|members|P[0-9]{2,8}[NC] 

In regular expressions dashes and dots need to be escaped. (this also crops up for things like favicon.ico and robots.txt that are typically in the root. They need to be written as favicon\.ico and robots\.txt for those that are using the exclude method)

Profile
 
 
Posted: 21 May 2009 08:24 AM   [ Ignore ]   [ # 33 ]  
Grad Student
Rank
Total Posts:  62
Joined  05-11-2009

FWIW,

here’s a quickie to stop HTTP/1.0 requests hitting your site. This is a nice vector for spammers, I’m told and all modern browsers speak HTTP/1.1

ReWriteCond %{THE_REQUEST} ^(.*HTTP\/1\.0[NC]
RewriteRule 
^(.*)$ - [F] 

I’ve tested this on Apache 2.x but not 1.3 or .htaccess but I expect it will work. I have it configured in a VHOST.conf.

Seems that .htaccess is frowned upon if you have the option. Most of us don’t.

Profile
 
 
Posted: 12 June 2009 08:29 AM   [ Ignore ]   [ # 34 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  257
Joined  06-25-2008

I’m having problems using the File and Directory Check Method on a multi-lingual site, set up using the Multi-Language site alternative.

On the whole the site is working fine. The only problem is member logouts. When a member logs out, the system doesn’t seem to register the logout properly, and the member doesn’t seem to be “really” logged out. The weird thing is logging in works fine, logging out causes the page to display as if the member is still logged in.

I’ve tried adding the rule explained here that is supposed to fix paths with the ?ACT=X query string in them, but no luck.

I can give a bunch more info, but any ideas where I should be looking to solve this?
Nik

 Signature 

nickfoxall.com | ExpressionEngine Development in Hong Kong

Profile
 
 
Posted: 12 June 2009 08:36 AM   [ Ignore ]   [ # 35 ]  
Grad Student
Rank
Total Posts:  62
Joined  05-11-2009

Can you post your .htaccess (or the rewrite code) that you’re using so we can see what you’re doing?

This works for me, but your mileage may vary (in particular, you need the names of each template group in the RewriteCond string

RewriteCond $^/(member.*|static.*|P[0-9]{2,8}[NC]
RewriteRule 
^(.*)$ /index.php/$1 [L] 
Profile
 
 
Posted: 12 June 2009 11:17 AM   [ Ignore ]   [ # 36 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  257
Joined  06-25-2008

My .htaccess code:

# rewrite rules
RewriteEngine On

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

RewriteCond 
%{QUERY_STRING} ^(css=.*)$ [NC]
RewriteRule 
^(.*)$ /index.php?/%1 [L]
RewriteCond 
$!^(images|systemfolder33|js|swf|es|en|themes|favicon\.ico|robots\.txt|index.php[NC]
RewriteRule 
^(.*)$ /index.php?/$1 [L]

RewriteCond 
%{QUERY_STRING} ^(ACT=.*)$ [NC]
RewriteRule 
^(.*)$ index.php?%1 [L]
RewriteCond 
$!^(images|systemfolder33|js|swf|es|en|themes|library|favicon\.ico|robots\.txt|index.php[NC]
RewriteRule 
^(.*) /index.php?/$1 [L] 

You can also try it out here: http://quinsa.net Login at the top of the page.
Login: testuser
Pass: User1

Nik

 Signature 

nickfoxall.com | ExpressionEngine Development in Hong Kong

Profile
 
 
   
2 of 4
2