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.

URL rewrite

February 12, 2009 9:36am

Subscribe [4]
  • #1 / Feb 12, 2009 9:36am

    spingh

    13 posts

    I need to rewrite the URL to “lowercase” (and some more rewriting).
    This is not possible in .htaccess.
    Is there a hook to break in the URL handling?


    http://www.example.com/This-IS-a-TeST-62843/

    Has to become:

    http://www.example.com/this-is-a-test/

  • #2 / Feb 13, 2009 5:56pm

    Robin Sowell

    13255 posts

    If it’s just when new entries are published?  Then yes, a hook would be the way to go.  If you’re only publishing via the cp (as opposed to moblog, api, etc) then I’d use a hook in system/cp/cp.publish.php to grab the url title before data entry and rewrite/write it. 

    If you’re talking about existing urls…  I personally would just go through the db and change the url_title in exp_weblog_titles to be lower case.  But I’d be sure I had a backup first.

  • #3 / Feb 16, 2009 6:16am

    spingh

    13 posts

    Unfortunately its neither, its about keeping
    old links alive :-(

  • #4 / Feb 16, 2009 1:17pm

    grrramps

    2219 posts

    Does it matter whether it’s upper case or lower case?

    For example, THIS, still takes the browser to THIS.

  • #5 / Feb 16, 2009 3:32pm

    Ingmar

    29245 posts

    Yes, it matters unless the server takes special steps. Or, of course, you are using Windows servers which are not case sensitive, as a rule. Ask your host about mod_speling (sic!).

    There might be other options, too.

  • #6 / Feb 16, 2009 3:45pm

    grrramps

    2219 posts

    Yes, it matters unless the server takes special steps.

    Unscientific test, of course, but I couldn’t find one in 20 servers that had a problem converting case, including EE. But there are some, and apparently quite a few issues, according to this and this and this.

    Or, of course, you are using Windows servers which are not case sensitive, as a rule. Ask your host about mod_speling (sic!).

    There might be other options, too.

    All kinds of potential problems and all kinds of solutions. It pays to make sure the host you use can handle common sense configurations as well as more esoteric needs.

  • #7 / Feb 17, 2009 4:28am

    spingh

    13 posts

    Case problem fixed, now for the last part, still need
    some kinda URL handling hook/hack.

    http://www.example.com/this-is-a-test-62843/

    Has to become:

    http://www.example.com/this-is-a-test/

  • #8 / Apr 15, 2009 4:36pm

    mediasauce

    14 posts

    I’m in a similar situation and my host isn’t going to allow me to make the necessary edits to allow for forcing lowercase URLs via mod_rewrite. Is there a way in EE to force the URLs to lowercase before they’re routed through the system?

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

ExpressionEngine News!

#eecms, #events, #releases