Prettyphoto and mod_rewrite
  • Hi,
    Im trying to get prettyphoto iframe to work with mod_rewrite for seo purposes. I can get the rewrite to fire off the overlay but it will not show content.

    The rewrite is along the lines of
    RewriteEngine On
    RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /vids.php?q=$1&width=$2&height=505&iframe=true

    the url im rewriting is
    http://www.100virals.com/242/830/Letterman,%20Oprah%20and%20Leno%27s%20superbowl%20party.html

    Is it a case of the rewrite happening after the document loads so that it isnt passing the right variable or am i just doing something really dumb?

    Alternatively, is there way we can show a pretty url and append the prettyphoto variables to link?

    And one more suspicion I have is that is that maybe as a result of the rewrite prettyphoto is looking for /242/830/vids.php rather than /vids.php. If that is the case, how would i set the link back to the root?

    Thanks for your time and any help you can give.
    Mo
  • Is the question dumb, badly presented or difficult to answer?
  • Hi,
    looks like ?iframe=true is getting lost somewhere on the way. Look this sends your site to my browser:


    so pP tries to load a pic instead..

    best regards
    bee
  • Thanks for the response bee. The iframe=true is in the rewrite so it should be part of the link. The image in the tag is the link on the page. I think pP is not getting the rewritten url. I guess no one has come across this before & I cant seem to find an answer. One of the people that have left an example of their work in the show your stuff section has implemented a jquery solution (http://www.groupedemontigny.com/Fournisseurs) but my javascript is very poor but I will see if i can figure out what he/she has done
  • No it does get it but the iframe parameter is lost, what i copied is the source code your site delivers. See any ?iframe=true ? me not.
    http://www.100virals.com/242/Letterman,%20Oprah%20and%20Leno%27s%20superbowl%20party.html this link works, sourcecode of empty pP overlay shows clearly it tries to load image.

    Try for yourself view->source or the like should be available in any browser.

    best regards
    bee
  • Thanks again bee. The mod_rewrite is a server side rules added to the htaccess file that changes urls. This allows you to have seo friendly urls such as www.site.com/page.html but really link to www.site.com/page.php?var=1&var=2 etc.
  • Seems to be working now http://www.100virals.com/ links have now ?iframe=true

    best regards
    bee
  • Yes but unfortunately that defeats the object of seo friendly links. I'm going to try and see if i can append the iframe=true after page load.
  • bee, just want to say thanks for your help. I have it sorted now.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!