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.

htaccess Exclude Method: Short word overwrites longer words that start with same letters

December 20, 2008 2:07am

Subscribe [1]
  • #1 / Dec 20, 2008 2:07am

    Ryan M.

    1511 posts

    I’m using the “exclude” method in my htaccess to remove “index.php” from my URLs. I have a line similar to this:

    RewriteCond $1 !^(css|js|tools|uploads|dev) [NC]

    “dev” is in there because I have a dev folder for a subdomain. However, I also have a template group called “developer” in EE. If “dev” is in this line, then http://www.site.com/developer/ throws a 404 error. If I remove it, the developer template group shows up as it should.

    How do I fix that?how do I match only “dev”, and not “developer”, or “devilish” or anything else starting with d-e-v?

  • #2 / Dec 20, 2008 10:24am

    Derek Jones

    7561 posts

    Try adding a trailing slash after ‘dev’, Ryan, so it knows to only avoid it when that directory is specifically being accessed:

    RewriteCond $1 !^(css|js|tools|uploads|dev/) [NC]

    or to add the same specificity to all of them:

    RewriteCond $1 !^(css|js|tools|uploads|dev)/ [NC]
  • #3 / Dec 20, 2008 9:33pm

    Ryan M.

    1511 posts

    Yep, that did the trick. I googled this but must have been using the wrong terms. Thanks for the help!

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

ExpressionEngine News!

#eecms, #events, #releases