|
#1
|
|||
|
|||
|
SEF URLs breaks comment popup for anything but latest photo
Hi everyone,
I'm using my own template (with SEF help from the modifications in theworldin35mm) along with .htaccess (below) to generate nice URLs for my site. But I'm having a problem with comments for any photo that isn't the most recent. When you visit the site, mysite.com/photoblog/ , you see the most recent photo and the popup comment url (http://mysite.com/photoblog/index.ph...nt&showimage=2) works fine. But when you browse to the previous photo, http://mysite.com/photoblog/p/1 , clicking the comment link doesn't work (404) because the url is rewritten. In the popup, however, I have links to comments for the next/prev photos and those aren't rewritten (although they should be, and I'm not sure why it's not) and it navigates fine. How can this be fixed? I've messed with the htaccess to no avail and I've messed with PP's index.php where the <comment_popup> is replaced, but I'm still stuck. Can anybody help? If it would help to see a live version, please PM me, as I'm still sorting this out on the site before I take it live. Much appreciated! THanks for your time! Code:
Options -Indexes RewriteEngine On RewriteBase /photoblog RewriteRule ^browse/?$ index.php?x=browse RewriteRule ^browse/([1-9][0-9]*)/?$ index.php?x=browse&pagenum=$1 RewriteRule ^browse/category/([1-9][0-9]*)/?$ index.php?x=browse&category=$1 RewriteRule ^browse/category/([1-9][0-9]*)/([1-9][0-9]*)/?$ index.php?x=browse&category=$1&pagenum=$2 RewriteRule ^browse/archive/(19|20)([0-9][0-9])[-](0[1-9]|1[012])/([^/]+)/?$ index.php?x=browse&archivedate=$1$2-$3 RewriteRule ^browse/archive/(19|20)([0-9][0-9])[-](0[1-9]|1[012])/([^/]+)/([1-9][0-9]*)/?$ index.php?x=browse&archivedate=$1$2-$3&pagenum=$4 RewriteRule ^browse/tag/([^/]+)/?$ index.php?x=browse&tag=$1 RewriteRule ^browse/tag/([^/]+)/([1-9][0-9]*)/?$ index.php?x=browse&tag=$1&pagenum=$2 RewriteRule ^comment/submit$ index.php?x=save_comment RewriteRule ^comment/([0-9]+)$ index.php?popup=comment&showimage=$1 RewriteRule ^(p|photo)/([0-9]+)$ index.php?showimage=$2 RewriteRule ^(p|photo)/([0-9]+)/rating/([1-5])$ index.php?showimage=$2&rating=$3 RewriteRule ^t/latest/?$ index.php?showthumb=latest&thumbtag=image RewriteRule ^feeds/(rss|atom).xml$ index.php?x=$1 |
|
#2
|
||||
|
||||
|
If manually typing in http://mysite.com/photoblog/p/1 gives you a 404 error, than you did not correctly setup mod_rewrite.
Some reason why URL rewrites give 404s
And please, provide a real URL, it would be nice to see the error happening in order to solve the issue more quickly and without requiring someone setup the same scenario on there own server. |
|
#3
|
|||
|
|||
|
Hi Joe,
Sorry about my original description, but viewing the photo doesn't give me a problem, so I know the rewrite works, it's just the popup link. So I have a live demo of what I'm talking about, using your template. It's at: http://inthedistance.net/photoblog/ You'll see that the (unstyled) comment popup works for the most recent photo, and the SEF URLs work for browsing. But the comment popup won't work for anything but the latest (ie., anything under the /p/# scheme). I hope that will help to explain the problem. I'd really love to get this fixed! Any insight you have would be epic. Thanks so much for checking it out! |
|
#4
|
||||
|
||||
|
Your problem is here
HTML Code:
<a href='index.php?showimage=<IMAGE_ID>' onclick="window.open('index.php?popup=comment&showimage=<IMAGE_ID>','Comments','width=480,height=540,scrollbars=yes,resizable=yes');">Comments (0)</a> HTML Code:
<a href='<SITE_URL>p/<IMAGE_ID>' onclick="window.open('<SITE_URL>comment/<IMAGE_ID>','Comments','width=480,height=540,scrollbars=yes,resizable=yes');">Comments (0)</a> HTML Code:
<form action="...">...</form> If you are going to use mod_rewrite URLs for pixelpost links, don't mix, some mod_rewrite URLs and some standard PP URLs. It just causes problems. And prefix all URLs with <SITE_URL>, since mod_rewrite URLs make using relative HTML links difficult. |
|
#5
|
|||
|
|||
|
Joe,
Thanks SO MUCH. That was awesome of you. I now have consistent URL structure across my template set, and I also had to add a "../" to index.php's replacement of the thumbnail_no_link tag to get the correct path to my thumb for display in the comment popup. Thanks again for the huge help! Getting very close to launching my site! |
| Post Reply |
| Thread Tools | |
|
|