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.

Restricted Words in URL_Segments?

July 22, 2010 4:54pm

Subscribe [2]
  • #1 / Jul 22, 2010 4:54pm

    UMstratcomm

    44 posts

    Greetings!
    I am using url_segments in a template in order to displays entries in a weblog.  I have a number of top-level weblogs.  For example:
    Information Technology (is)
    Academic Affairs (aa)
    Government Relations (gr)
    Human Resources (hr)
    Finance Administration (fa)

    ...Where the acronym in the parenthesis is the url segment.  So, if the URL is http://sitename.com/is, the Information Technology weblog will be used, and so forth.

    This works great, with the following exception: the HR and FA url segments will not work, and my default 404 page is displayed.  If I rename ‘fa’ to anything else, such as ‘fatr’ (and renaming ‘hr’ as well), then it works fine.

    Is there a limit to what words can be used in url_segments, or are there restricted words that will cause an error?  If not, do you have any idea what could be causing this…Perhaps a conflict with a weblog or category name?

    I am using EE ExpressionEngine 1.6.9 Build:  20100430.  I am using the LG TinyMCE Custom Field extension, as well as the MX Title Control extension; I disabled both, which did not affect the problem/solution. Additionally, I deleted the FA weblog, and create a new one with the same name and configuration.  This did not fix the problem either.

    Any help is appreciated.

    Thanks!

    UMStratcomm


    Update:  here is the exp:weblog:entries code that I am using -

    {exp:weblog:entries weblog="fa" url_title="fa_index" limit="1"}
    {body}
    {/exp:weblog:entries}
  • #2 / Jul 22, 2010 5:17pm

    Ingmar

    29245 posts

    I would suspect a server side issue, most likely mod_security. Ask your host about it.

  • #3 / Jul 22, 2010 6:09pm

    UMstratcomm

    44 posts

    Thanks for the information, Ingmar.  I am not sure how modSecurity would restrict letter combinations for one segment, but not for another letter combination of the same segment…But I will see what I can find out.  For what it’s worth: if I create the same url segment manually (by creating sub-directories on the web host), the url segments works just fine.

    Update:  we could not find anything out of the ordinary with modSecurity.  That being said, I tried a manual query in place of the “traditional” weblog.

    {exp:query sql="SELECT e1.title, e1.entry_date, e1.edit_date, e2.field_id_2 FROM exp_weblog_titles e1, exp_weblog_data e2 WHERE e1.entry_id = e2.entry_id and e2.weblog_id = 91 and e1.url_title = 'fa_index' LIMIT 1"}
    <h2>{title}</h2>
    <p>{field_id_2}                    <br />
    {if no_results}<br />
    error message<br />
    {/if}<br />
    {/exp:query}

    Surprisingly, this works: the index page was displayed for the ‘fa’ segment.  I am not sure of the logistical ramifications of using queries such as this to display content, but hopefully it will at least shed a bit more light on my problem.


    Regards,
    UMStratcomm

  • #4 / Jul 22, 2010 8:24pm

    Brandon Jones

    5500 posts

    UMstratcomm,

    Have you tested this without an .htaccess file and with ‘index.php’ set as your site’s index page in General Configuration?

  • #5 / Jul 23, 2010 11:15am

    UMstratcomm

    44 posts

    UMstratcomm,

    Have you tested this without an .htaccess file and with ‘index.php’ set as your site’s index page in General Configuration?

    I removed the .htaccess file, and set index.php as my site’s index page, and I get the same issue.  I will keep digging, but please let me know if you have anything else that I can try.

    Thanks!

    UMStratcomm

  • #6 / Jul 23, 2010 11:21am

    Ingmar

    29245 posts

    Please take another look at the mod_security angle. I’ve seen cases where a few letters in the url or some other strategic place have triggered it.

  • #7 / Jul 23, 2010 11:46am

    UMstratcomm

    44 posts

    Please take another look at the mod_security angle. I’ve seen cases where a few letters in the url or some other strategic place have triggered it.

    Can you please share an example of what I should be looking for?

    Not sure if I am kicking a dead horse, but if I replace all “index page” exp:weblog:entries instances with exp:query blocks, it works fine.  In this case, “index page” loads a specific entry that is triggered by a url segment.  For example:  http://mysite.edu/ums/departments/ed - the url segment of ‘ed’ should load the “ed_index” entry, specified in the following block of code:

    {exp:weblog:entries site="default_site" weblog="ed" url_title="ed_index" limit="1"}
    {if no_results}
    {redirect="ums/errordocument"}
    {/if}
    <h2>{title}</h2>
    <p> {body}<br />
    {/exp:weblog:entries}

    So, the actual url_title is not in the url segment.  This works for most of my template, with the exception of the ‘fa’ and ‘hr’ segment.  If I replace all index-related exp:weblog:entries blocks with exp:query blocks, everything works fine.  Is there something that I should be adding to my exp:weblog:entries snytax?

    Thanks again,
    UMstratcomm

  • #8 / Jul 23, 2010 11:54am

    Ingmar

    29245 posts

    Can you please share an example of what I should be looking for?

    Simply ask your host whether you server is, in fact, using mod_security and whether it might possibly interfere with your site.

  • #9 / Jul 23, 2010 2:09pm

    UMstratcomm

    44 posts

    Can you please share an example of what I should be looking for?

    Simply ask your host whether you server is, in fact, using mod_security and whether it might possibly interfere with your site.

    This is what the host told me:

    We have not enabled or installed mod_security, the only firewalls are the local IPTABLES and the hardware based ones.

    We are using portsentry, if that could be part of the problem?

  • #10 / Jul 23, 2010 5:39pm

    Brandon Jones

    5500 posts

    We are using portsentry, if that could be part of the problem?

    I’m not familiar with it, but one suggestion is to see if you can replicate this behavior on a local install (or another server) which would help pinpoint the issue.

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

ExpressionEngine News!

#eecms, #events, #releases