6

I am currently using a non-official .htaccess rewrite to deal with index.php and a few other bits and pieces. Since it looks like I am going to try and take care of the other bits and pieces with Router, I want to get the .htaccess back to something closer to the official setup to make future support easier.

However, I don't think the straight-up official version will do since I have one index.php in my main directory and additional index.php files in five subdirectories. Basically, I am running multiple sites with the old method, but they're neither domains or subdomains, just folders. So I need those index.php files removed as well and if possible I would prefer to do it from a single .htaccess file instead of adding a new one in each subdirectory.

This is what I use right now (with "GoT" being one of the subdirectories with its own index.php):

RewriteRule ^/?((ASoIaF|Digest|Images|Login|Store|Updates|member)(/.*)?)$ /index.php/$1 [NC,L]
RewriteRule ^/?GoT/((Characters|Episodes|Features|Gallery|News)(/.*)?)$ /GoT/index.php/$1 [NC,L]

Can that be brought closer in line with the official method while still using a single .htaccess? Or is that just making things unnecessarily complicated?

1 Answer 1

1

Some important points to keep in mind.

Ellislab doesn't support server configurations (rewrites in the case.) They don't have the expertise for this. While they do have a preferred rewrite scheme that they will support, the more your situation deviates from that simple scenario, the less likely they will be able to support you.

With the introduction of the Multi Site Manager, this is the supported method for running multiple sites. If you aren't using MSM, then you may need to pick that up for your setup to be supported by Ellislab.

Rewrites can be tricky and there are many ways to do them. If your rewrite scheme is working, then you are doing it right. I would also suggest that you stick with one .htaccess file per site as you are currently doing. This will reduce the likelihood (less complex.)

This question is also good for https://serverfault.com/ as Apache rewrites aren't CMS specific.

1
  • Thank you for your suggestions. :) MSM isn't feasible for the way my site is constructed, so I guess I might as well stick with the rewrites that I use, since I'm in unsupported territory anyway. Dec 2, 2012 at 23:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.