Events Made Easy › Forums › How do I … › Getting Permalinks to work for events
Tagged: permalinks
- This topic has 11 replies, 2 voices, and was last updated 14 years, 2 months ago by Anonymous.
-
AuthorPosts
-
Sun 3 Oct 2010 at 14:04 #42123AnonymousInactive
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!
Sun 3 Oct 2010 at 14:20 #44890FrankyKeymasterEME works perfectly with permalinks, but you’ll indeed need to fiddle around in the .htaccess rules to get what you want.
Mon 4 Oct 2010 at 09:30 #44891AnonymousInactiveI’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.
Mon 4 Oct 2010 at 09:32 #44892AnonymousInactiveI’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.
Mon 4 Oct 2010 at 10:02 #44893FrankyKeymasterWell, 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
Mon 4 Oct 2010 at 19:06 #44894AnonymousInactiveYes, 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.
Mon 4 Oct 2010 at 22:21 #44895FrankyKeymasterFor 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.
Tue 5 Oct 2010 at 07:22 #44896AnonymousInactivewith 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…
Tue 5 Oct 2010 at 08:07 #44897FrankyKeymasterMaybe not. Try apache mod_substitute:
Tue 5 Oct 2010 at 14:33 #44898AnonymousInactiveYes! 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…
Tue 5 Oct 2010 at 15:27 #44899FrankyKeymasterTry 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
Tue 5 Oct 2010 at 16:24 #44900AnonymousInactivethe [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.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.