I have recently upgraded my site from EE 1 to EE 2 and it appears to have resulted in some of my .htacess rewrites to change the URL structure no longer working.
I imagine there’s been some internal changes in URL handling between EE 1 and EE 2, but I can’t quite grasp how it could stop these rewrites from happening. Isn’t a rewrite the first thing that gets done, so shouldn’t EE be seeing the rewritten URLs and nothing else?
Thank you for responding. However, I need more than just the standard index.php rewrite since I sometimes need to remove a template group as well or part of a Page URI. The rewrites that need just index.php removed are working for me.
RewriteRule ^index.php/(playa|wygwam|fieldframe|ffmatrix)(/[^\\/]+)?(/.+)?$ /index.php/ee$2/$1/$3 [NC,L]
This little redirect (coupled with a standard index.php redirect) will take an incoming URI like /playa, and turn it into /index.php/ee/playa behind the scenes.
I just can’t figure out if that can apply to my situation, in part because I don’t quite see why he’s starting the rule with index.php when he says the incoming URI will be /playa. I also don’t see why its /ee$2/ and not just /ee/. But from the description it is doing what I need, allowing for a template group to be removed. It seems like that would also work for part of a Page URI, unless something internally prevents that.
I am afraid I don’t follow that at all. I am not trying to do any php includes. When I mentioned templates and template groups it was in reference to how ExpressionEngine structures its content, in case someone here was familiar with it.
Ralph’s method won’t work, unfortunately, because I need more than just the index.php removed from the URLs. What I had worked fine for EE 1 but broke after I upgraded to EE 2. I am trying to track down why, since I don’t know enough myself about either .htaccess or EE.
Could you say a bit more about why you need certain template groups removed? If you just use the code I gave, you’d be able to access year search page at
which is normally how it should be presented with EE. If you are wanting to remove the /Westeros/ from that, it would be better to put the search page in its own /search template group. That would save you a lot of problems.
Is that basically the sort of thing you are trying to do, or is it more complex than that?
Yes, I need to also remove /Westeros/ from that. If it was just Search, I could have created its own template group, but I have a number of templates that need to display right after the domain and adding a template group for each just didn’t seem ideal. So, on EE 1 I set them all up in the Westeros template group and used .htaccess to remove the group and it worked just fine. But, that’s no longer the case now that I have upgraded to EE 2.
The other issue is with pages, where I also added in a site-identifier as part of the URI (I run multiple sites off one EE install, and since two pages cannot have the same URI, I needed to separate them out) and used .htaccess to remove that part. That, too, worked in EE 1 but breaks in EE 2.
In part, I am just trying to figure out why it breaks now and if there’s any work-around that allows me to keep my current URLs, since anything else would mean a lot of restructuring of the site. I am told by others that the example I posted before dklynn’s post should work, and as far as I can tell, it also removes the template group, so that would suggest this is still doable in EE 2.