Events Made Easy Forums How do I … Getting Permalinks to work for events

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #42123
    Anonymous
    Inactive

    Hey. I was checking out the existing threads for permalinks and everything seems to be set up for my system.

    I would like the a URL of this type:

    /events?calendar_day=2010-10-17

    to show up as a URL of this type:

    /events/calendar_day=2010-10-17

    If I type in /events/?calendar_day=2010-10-17, it works, but after the request is returned, firefox displays the URL as /events?calendar_day=2010-10-17… I would like the ‘?’ to be replaced by a ‘/’. And I want all the anchors in the calendar and widget to show the URL’s without the ‘?’.

    Is this clear?

    Do I have to edit the .htaccess file by hand to enable this?

    Thanks!

    #44890
    Franky
    Keymaster

    EME works perfectly with permalinks, but you’ll indeed need to fiddle around in the .htaccess rules to get what you want.

    #44891
    Anonymous
    Inactive

    I’m not sure what you mean when you say that it ‘works’ with permalinks – sorry just don’t have experience with WordPress. Do you mean that wordpress should be creating the permalinks automatically for events? It treats them just like posts? Or do you mean that I have learn mod_rewrite and add the rewrite code in my htaccess file by hand?

    Do you have a simple example that would explain it to me a bit more?

    I’ve checked all the posts on the forum about permalinks, but nothing makes it clear for me, sorry.

    #44892
    Anonymous
    Inactive

    I’m not sure what you mean when you say that it ‘works’ with permalinks – sorry just don’t have experience with WordPress. Do you mean that wordpress should be creating the permalinks automatically for events? It treats them just like posts? Or do you mean that I have learn mod_rewrite and add the rewrite code in my htaccess file by hand?

    Do you have a simple example that would explain it to me a bit more?

    I’ve checked all the posts on the forum about permalinks, but nothing makes it clear for me, sorry.

    #44893
    Franky
    Keymaster

    Well, wordpress has an option to activate permalinks and when you do, it creates a .htaccess file that reflects your setup. See here: http://codex.wordpress.org/Using_Permalinks

    #44894
    Anonymous
    Inactive

    Yes, thank you. I have read that codex page. And I have activated permalinks with the custom structure:

    /%category%/%post_name%

    What I am not understanding is how it works with EME. How do I get the links I indicated in my first posting? Do I have to edit the .htaccess file by hand? Or should it just work automatically?

    What I have now are URL’s that look like this: /events?calendar_day=2010-10-07 what I want are URL’s that look like /events/calendar_day/2010-10-07, or instead of /events?event_id=5 I want /events/5

    Do I edit .htaccess by hand, or should this work automatically with permalinks configured to /%category/%post_name%

    Thanks.

    #44895
    Franky
    Keymaster

    For the moment EME creates these links, since it’s impossible to know the permalinks you want to have. I think in your case you’ll need a reverse proxy of some kind that rewrites the html-content like you want it. I’ll need to study permalinks more, but for now this is impossible with EME itself.

    #44896
    Anonymous
    Inactive

    with the following rule in the .htaccess file I can use /events/5 to properly handle incoming requests:

    RewriteRule ^events/([0-9]+) events?event_id=$1

    but of course the URL’s generated by EME still look like events?event_id=5… so I guess mod_proxy is needed to fix that…

    #44897
    Franky
    Keymaster

    Maybe not. Try apache mod_substitute:

    http://httpd.apache.org/docs/2.2/mod/mod_substitute.html

    #44898
    Anonymous
    Inactive

    Yes! That did it! Thank you! I added the following code to my .htaccess file:

    <IfModule mod_substitute.c>

    AddOutputFilterByType SUBSTITUTE text/html

    Substitute “s|events?event_id=|events/|”

    </IfModule>

    and now all the URL’s for event_id come out properly.

    But… I am still completely stuck for the URL’s with the events?calendar_day=2010-10-16 format!!! I get page not found… I turned on debugging and i was looking at the rewrite log, but I just can’t figure out what is happening. Just to get something simple working I tried the following:

    RewriteRule ^events/calendar_day=(.*)$ events?calendar_day=$1

    just to test substituting the ‘/’ for a ‘?’ but it doesn’t work. page not found error. If I force a redirect and list it as the last rule, it works but of course the URL in the browser now shows the ugly URL… I am still learning how to read the rewrite log…

    #44899
    Franky
    Keymaster

    Try this (adding [NE] at the end):

    RewriteRule ^events/calendar_day=(.*)$ events?calendar_day=$1 [NE]

    Otherwise the “?” gets escaped. You should have the same problem with

    RewriteRule ^events/([0-9]+) events?event_id=$1

    #44900
    Anonymous
    Inactive

    the [NE] didn’t make a difference. the event_id rule works with or without it, and the calendar_day rule only works with a [R,L] redirect.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top