ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

What mod_rewrite method does ExpressionEngine.com employ?

February 11, 2008 12:10am

Subscribe [5]
  • #1 / Feb 11, 2008 12:10am

    stevefink

    136 posts

    Hi all,

    I’m curious what methodology described in http://expressionengine.com/wiki/Remove_index.php_From_URLs/ does this actual site, http://www.expressionengine.com, employ?

    I would ultimately love to get rid of index.php + Template group name. It’s stated in the wiki that this is advised against doing. However, it appears that you folks are doing it here and clearly are not having issues.

    With that said, would it be okay to ask what kind of re-write rules you’re using? I’d typically be able to throw together some rules as I’m an avid mod_rewrite user, however I’m not aware what ramifications this will have on EE’s internal engine, so I’d rather avoid trying to pretend that I’m clever.

    Thank you kindly for any advice.  I, and my users, will certainly enjoy http://foo/about and http://foo/faq versus http://foo/index.php/mysite/about/ and http://foo/index.php/mysite/faq type URLs.

    Cheers,

    /sf

    [Mod edit: moved to General Discussion]

  • #2 / Feb 11, 2008 11:28am

    Derek Jones

    7561 posts

    To be clear, we are not getting rid of the template group.  That severely runs counter to how ExpressionEngine is designed to work from the ground up, so you can easily get yourself in a situation where you have to apply hacks or extensions just to get things working properly, and there is absolutely no guarantee that such changes would continue to work from version to version.  I cannot stress this enough - you will be much better off if you work with the application instead of against it.  There’s no reason to use a ‘mysite’ template group when you can just create ‘about’ and ‘faq’.  With the many different types of global variables and embedded templates, you will not be repeating your work, and will have much clearer site organization, which will have additional benefits when making changes or additions down the road.

    For index.php removal we’re using the exclude list method.

  • #3 / Feb 11, 2008 12:09pm

    stevefink

    136 posts

    Hi Derek,

    Thank you for the reply. Sorry for making the assumption that you’re removing the template group. The last thing I want to do is work against the system. 😊  I’ll have to re-work my template scoping and use my default one as global so I can avoid having to route to it specifically.

    I’ll give that a twirl later on today.

    Thanks for the reply and letting me know about the exclude list method.

    /sf

  • #4 / Feb 11, 2008 12:22pm

    Derek Jones

    7561 posts

    No problem, Steve.  I hope I didn’t come off as caustic in my reply, but I’m speaking from personal experience on this front.  Before I began employment with EllisLab, I created an EE site where I removed the template group, all excited that I was only going to use 2 templates to run the whole site, and that my URLs would be short enough for toddlers to say out loud.  It was an absolute pain.  Everything about that type of organization that I thought was being clever and elegant turned out to not be the case.  I easily spent twice the time developing that site as I would have using template group structure as intended, and that site to this day is a pain to update.  And the end result?  Most of the URLs average 5 characters shorter than they would have otherwise, humans don’t notice, and search engines don’t care.  What’s worse is that if I don’t work on the site for a few months, when I need to make a change, I have to relearn all of the “clever” things I did when I originally created the site.

  • #5 / Feb 11, 2008 12:30pm

    stevefink

    136 posts

    Derek,

    Totally understood!  I’m completely grateful to receive the level of support offered here. Wasn’t offended at all, man!

    I’ll just need to figure out how to make the scope global when I’m working on my site later today and that should take care of my needs, regardless!

    Thanks again. 😊

    /sf

  • #6 / Feb 12, 2008 11:13am

    Sue Crocker

    26054 posts

    Steve, one other approach you can use is to use the Pages module. That gives you much more flexibility to achieve shorter urls. (Or what *appear* to be shorter URLs.)

    Have you considered using it?

  • #7 / Feb 13, 2008 7:37am

    GDmac - expocom

    350 posts

    As mentioned in the wiki, ‘include’ en ‘exclude’ options have their issues…
    (Like, ...don’t forget to add that directory you just made to the .htaccess).
    But that is a matter of personal taste and approach.
    I most of the time use a copy of index.php and renamed it and then let the
    server know that it is a .php file. example: duplicate ‘index.php’ to ‘hotbath’,
    set htaccess to parse ‘hotbath’ as php-code. (/docs/installation/renaming_index.html)

    <Files hotbath>
    ForceType application/x-httpd-php
    </Files>

    After that, let ExpressionEngine know what your new index-file is named, (general configuration).
    Now you have a more SEO friendly and human-readable url and you can take
    a dive into the ‘hotbath’ instead of index.php 😊
    http://www.example.com/hotbath/blog
    http://www.example.com/hotbath/products
    etc.

  • #8 / Feb 13, 2008 9:54am

    Derek Jones

    7561 posts

    Yes renaming to something with additional semantic meaning as GDmac suggests is what I tend to first go with, if there’s something that suits the site well.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases