Question

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?

Was it helpful?

Solution

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)

OTHER TIPS

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

If you want to use standard practice and without query string you need to just follow these steps and it will work just like localhost And you need not change rewrite rules.

Go to your godaddy account file manager --> WebRoot directory --> Create php5.ini if it does not exist and place following line: cgi.fix_pathinfo = 1

Now you need to restart your Web Process:

1.) Log in to your Account Manager. 2.) Click Web Hosting. 3.) Next to the hosting account you want to use, click Launch. 4.) In the Stats & Monitors section, click System Processes. 5.) In the list on the left, click the process you want to view or click All Processes to view all processes at once. 6.) To end a process, click the corresponding end button on the toolbar.

Now you can use URI_PROTOCOL as Auto.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top