1

I had do move a functionally old EE 1.6.8 website to a new hosting. It does working so far after I changed the RewriteCond from:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L] 

to:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L] 

It seem's my new Host requires forced query strings.

But now there are problems to fetching superglobal values in a specific template. I use the following code to catch three values from the URI there:

URI:

http://www.xxxx.ch/kontakt/projectform?mitarbeiter=test&projekt=test&kunde=test

Template code:

<?php

function get_id($idname) {

        global $IN;

        $id = $IN->GBL($idname, 'GET');
        echo $id;

}

?>

{assign_variable:mitarbeiter="<?php echo get_id('mitarbeiter'); ?>"}
{assign_variable:projekt="<?php echo get_id('projekt'); ?>"}
{assign_variable:kunde="<?php echo get_id('kunde'); ?>"}

{mitarbeiter}
{projekt}
{kunde}

They were all catched on the old hosting, as well when I run the EE with no or clear .htaccess file. I'm not very well expierenced in writing .htaccess files but could be made an exception rule for this template?

Thanks for any hints or advices!

0

This URL appears to function:

http://www.nanotronic.ch/kontakt/projectform/&mitarbeiter=test&projekt=test&kunde=test

You might be able to use jQuery or something to build that URL on whichever page/function is generating that address.

If you absolutely have to do it with mod_rewrite/htaccess, I'd imagine there's a way to do it, but, I'm not sure of what it would be.

| improve this answer | |
  • I changed the way to build the required URI – was the easiest. Thanks a lot anyway! – user2610 Jan 17 '14 at 8:31
2

In your htaccess, you can add another rule that recognizes query strings, and then appends them with an & to the page URL that gets turned into the first part of the query string (after the ?).

Something like this should work:

RewriteEngine on

#URLs WITH a query string
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^(.*)$ /index.php?/$1\&%{QUERY_STRING} [B,L]

# URLs WITHOUT a query string
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L] 

I've done something like this on EE 1.6x sites under FCGI hosting, and had it work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.