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.

Entries don’t display with period in URL title (cont.)

July 23, 2010 3:13pm

Subscribe [2]
  • #1 / Jul 23, 2010 3:13pm

    John Morton

    84 posts

    This is a topic that was brought up in the old forums but never found a solution so I wanted to continue you it here to see if there is a solution to be found.

    Link to same topic in old forums.

    A quick recap:

    Since EE 1.6.5, URLs are able to have periods in them.

    Some people (including me) are having issues removing index.php using an htaccess file in the case where an automatically generated URI has a period in it.

    For example, if you visit:
    http://supergeekery.com/index.php/geekblog/comments/testing_with_this_entry._no_need_to_read
    it will work as expected. It shows the expected entry.

    If you visit:
    http://supergeekery.com/geekblog/comments/testing_with_this_entry._no_need_to_read
    it will not. Not only does it not throw a 404 which I wish is would (another problem I’m trying to solve), it doesn’t actually pass the correct URI to the database.

    (Those are temporary URLs that will be deleted soon, BTW.)

    First, I’ll show you my super basic htaccess file.

    RewriteEngine On
    
    # is this NOT a request for a regular file? ie !-f
    RewriteCond %{REQUEST_FILENAME} !-f
    
    # is this NOT a request for an existing directory? ie !-d
    RewriteCond %{REQUEST_FILENAME} !-d
    
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    
    # EE 404 page for missing pages
    ErrorDocument 404     /index.php/staticpages/404

    Simple, I think.

    Next if I’ve got some screenshots showing the URIs that are being passed into the EE system.

    If I’m using index.php, the URI is correct. It has the period in the URI.

    http://emberapp.com/johnfmorton/images/google-chrome-2/sizes/m.png

    If I’m using the htaccess rules above, the period is substituted with an underscore. I’m unsure why that’s happening.

    http://emberapp.com/johnfmorton/images/google-chrome-3/sizes/m.png


    What’s NOT showing in the above image is the HTTP HEADERS for this URL. It shows the QUERY_STRING to be correct: /geekblog/comments/testing_with_this_entry._no_need_to_read.

    The ‘easy’ solution would be for no URI to have periods. It wouldn’t solve the problem, but it would at least avoid it.

    In the EE-pre-1.6.5 days, when a URI was being automatically generated for you, what happened when you typed a period into your title area? I assume it didn’t automatically insert a period because it wasn’t a valid URI for EE then. Is there any way to toggle that behavior back on?

    Ideally I would like to fix the redirection of existing URLs and have them work. Next I would like to turn off the behavior of having periods in the URIs to begin with.

    Any thoughts?

    (This issue, of not getting the 404 for a non-existing URIs, may or may not be related to this problem.)

  • #2 / Jul 23, 2010 3:21pm

    Sue Crocker

    26054 posts

    John, unfortunately we don’t supply support for using .htaccess to remove index.php. I can move this to the CodeCorner to see if anyone in the community has an idea.

  • #3 / Jul 23, 2010 4:20pm

    John Morton

    84 posts

    Thanks, Sue.

    I’ve also discovered this in the CI forums on the same topic:

    http://ellislab.com/forums/viewthread/94091/

    Based on that, I’ve tried using the following in my config file:

    $config['uri_protocol'] = "QUERY_STRING";
    $config['uri_protocol'] = "AUTO";

    It DOES fix the problem, but seems to break many other things on my site. All styling is gone, for example.

    That entry I linked to says the “server is injecting the underscores for periods when it fills the PATH_INFO environment variable.”

    Hmm… Trying to figure out next step…

  • #4 / Jul 23, 2010 4:32pm

    John Morton

    84 posts

    Sue, you helped me out and you didn’t even know it!

    I saw a thread in the old forums on URL parameters here:

    http://ellislab.com/forums/viewthread/138653/

    You suggested trying the following in the config file:

    $config['uri_protocol']    = "REQUEST_URI";

    That fixed the problem I was having with the periods being changed in the URI.

    What I think was happening is that my server was substituting underscores for periods for GET variables. Code Ignitor/EE was using this as the URI String.

    Using the new config setting still returns my GET variables with the underscore instead a period, but now the URI String reports back as the original version with the period intact.

    Sweet.

    😊

  • #5 / Jul 23, 2010 5:50pm

    Sue Crocker

    26054 posts

    Cool! Glad that worked for you.. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases