I have the following .htaccess
RewriteRule ^register.html$ ?page=register
I have a jquery ajax function which requests the following normally, it works.
www.blabla.com/#!?page=register&module=ajax
However, it get’s bugged when I use it with .htaccess
www.blabla.com/#!kayit.html&module=ajax [HTTP/1.1 404 Not Found 114 ms]
How can I solve this, any ideas?
You simply can’t. You are using the fragment identifier (the text after the hash symbol) as a path (which normal procedure for ajax-y websites), but the fragment identifier never even reaches the server.
You have to make an ajax request to the server with the content of it.
The actual question would be, how to merge GET variables from the Rewrite Rule with the ones, already provided.
So in your example, you want the URL
register.html?var=1to be redirected to?page=register&var=1. You can do that by adding theqsappend(query string append) flag:Docs: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewriteflags