I've had a similar question up on Stack Overflow, but now that we've got this shiny new site, I figured I might as well bring it here.
With EE 2, is it possible to remove anything other than index.php from the URLs via .htaccess rewrites? I am thinking of, for example, a non-default template group or part of a Page URI.
Both these things could be done in EE 1 but no longer work for me in EE 2. I have tested my rewrites using http://htaccess.madewithlove.be/ and as far as I can tell, they do result in the correct URLs. However, attempts to access the pages lands me on my default page.
My original setup was this:
RewriteRule ^/?((403|404|About|Chat|Contact|Copyright|Search)(/.*)?)$ /Westeros/$1 [L] RewriteRule ^/?((ASoIaF|Digest|Images|Login|Store|Updates|Westeros|member)(/.*)?)$ /index.php/$1 [L]
I've also tried this:
RewriteRule ^/?((403|404|About|Chat|Contact|Copyright|Search)(/.*)?)$ /index.php/Westeros/$1 [L] RewriteRule ^/?((ASoIaF|Digest|Images|Login|Store|Updates|member)(/.*)?)$ /index.php/$1 [L]
There's a couple of different things going on and some work and some don't, in both of these scenarios.
1) domain.com/Updates/ works fine. Updates is a template group. So, no problems with just removing index.php.
2) domain.com/Search/ does not work. Search is a template within the Westeros template group. It does work to access it as domain.com/index.php/Westeros/Search/. The reason for this rewrite is that I wanted to avoid creating several single-template template groups to handle things like Search, Contact, etc. At the same time, its important that these segments come right after the domain given the overall structure of the site.
3) domain.com/About/ does not work. About is a Page with its URI set to /Westeros/About/. It does work to access it as domain.com/index.php/Westeros/About/. Again, I need these Pages to display right after the domain to fit into the overall structure of the site, but since I am running multiple sites using the old method (multiple index.php files) rather than MSM, I cannot simply make the URI /About/ for the Page since I have an /About/ Page for each site/subsite.
In case .htaccess can't be used for this any longer in EE 2, are there any other options available for these sort of behind-the-scenes URL changes?
Edited to add: I have now received a support answer from EE on this matter and even though removing the template group is unsupported, they pointed to a config option that has restored the EE 1 behaviour for me. This is the URI Protocol option in config.php; default in EE 2 is "auto" but if I set it to "path_info" instead, the rewrites work as they did in EE 1.