views:

515

answers:

2

After uploading my Kohana project to my Godaddy server, I noticed my standard .htaccess file wasn't working sufficiently to provide the clean URLs. After some guidance, I ended up with the following rule:

RewriteRule .* index.php?kohana_uri=$0 [PT,L]

This got my nice-URLs working again, but today I find out that it may be breaking my internal search-engine, which also uses GET-style variables:

/search?terms=php

The values aren't being found by the scripts. They are on my development-server which doesn't have the modified RewriteRule, but not on the Godaddy server which does use the RewriteRule.

Am I right in assuming that rule is breaking any scripts ability to read from $_GET, and if so how can I remedy this?

+1  A: 

I think you could add: RewriteCond $1 !^(search), or a variation of such.

arbales
+5  A: 

Hi,

Maybe using QSA in your rewriterules, like this :

RewriteRule .* index.php?kohana_uri=$0 [PT,QSA,L]

See the manual of mod_rewrite (quoting) :

'qsappend|QSA' (query string append)

This flag forces the rewrite engine to append a query string part of the substitution string to the existing string, instead of replacing it. Use this when you want to add more data to the query string via a rewrite rule.

Might help (not tested in your particular case, but I remember have used this some time ago, for some kind of problem like this one)

Pascal MARTIN
That worked. I'll wait and let others participate (since I know very little about .htaccess, and as such if this is the best solution) before I accept. Thank you!
Jonathan Sampson
No problem :-) you're welcome!
Pascal MARTIN