View Full Version : Tabbed Div script problems when using mod-rewrite

02-19-2007, 02:13 PM
Tabbed Content


I've implemented this on a site I've been writing (www.financial-gurus.com) and it has been working fine. I've decided to use a mod-rewrite rule to format the URL in a nicer fashion when going to a specific guru's profile. This seems to have screwed up the tabber script causing it to display none of the content.

By viewing source, I can see the content is all there (so the re-write rule is working and the content is being fetched from the DB), but it remains hidden.

If I remove the entry

display: none;

...then all content is displayed (as you might expect) and if I call the page straight with the $_GET variable, it works fine. If anyone can shed any light on how the rewrite could be affecting this script, i'd be very grateful.

http://www.financial-gurus.com/profile.php?guru=2124 - standard page, no rewrite, working fine.

http://www.financial-gurus.com/gurus/Jonathan_Davis/2124/ - with the SE friendly re-write, no showing content, but if you view source the content is there.

Thanks in advance.

02-20-2007, 02:22 AM
Firstly, please note that your page is currently in violation of our usage terms (http://www.dynamicdrive.com/notice.htm), since the credit notice doesn't appear inline on the page. Please reinstate the credit notice.

Regarding your question, make sure the reference to tabcontent.js within your page is an absolute URL:

<script type="text/javascript" src="http://mysite.com/subdir/tabcontent.js">

URL rewritting modifies the URL virtually, but references to .js files must still be to their original, true locations.