your question might be better directed at a mod_rewrite group but I'll do
my best here.

And a few suggestions right off the bat.  I would use a framework like
codeigniter if you're going to work with URI's like that.  It already has
built in functionality to work with those sorts of things.  another
suggestion would be to use === or strcmp() to enforce some sort of type
checking on your variable to rule out any inconsistencies there.

Can you post your jQuery code as well so that we can check for any possible
bugs there?

Also, here is a good tutorial on mod_rewrite that might help:

http://www.sitepoint.com/article/guide-url-rewriting/

cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-919-517-1568 Tieline:  255-1568
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


                                                                       
  From:       startail <ander...@sonic2000.org>                        
                                                                       
  To:         "jQuery (English)" <jquery-en@googlegroups.com>          
                                                                       
  Date:       02/16/2009 09:12 AM                                      
                                                                       
  Subject:    [jQuery] jQuery with mod_rewrite                         
                                                                       






Hi,

I'm having problems with jQuery and mod_rewrite. I read someone here
before that had problems with it but I couldn't figure out what was
wrong with my code.

What I do is this,

RewriteBase /
RewriteRule ^([^.]+)$ /index.php [L]

In index.php I then split all "/" to sepperate variables.
For example,

/member/edit will tell index.php to include the page member.php, that
I do with include "member.php", and that variable $_URI['type'] is
edit.

So now we have  $_URI['page'] = member.php, $_URI['type'] = edit

In member.php I check what type of function the page should load, here
we want to do edit. So I hve this in my code,

if($_URI['type'] == "edit")
{
  // Do this
}

But my jQuery code does not work with this. What can I do to make my
jQuery code to work?
If I change everything and load the page with just member.php?
type=edit my code works perfectly, it's my mod_rewrite code that seems
to be screwing things up.

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

Reply via email to