My host does not have register globals turned off. Is there a way to embed the code below into the drupal .htaccess file - i have tried and im getting server errors:

RewriteEngine On

RewriteRule ^content(.*) index.php
RewriteRule ^component/(.*) index.php

php_flag register_globals off
Order allow,deny
Allow from all

Or can someone advise me?

Comments

emjayess’s picture

I used to get the problem with register_globals using 1&1 shared hosting (business linux package)... by default, php version was 4.4.7 with register_globals on, but I had the option to use PHP5. I added a line to Drupal's .htaccess file to use PHP5 for my drupal installations instead, which resolves the issue!

Refer to my comments and .htaccess example here: http://drupal.org/node/296026#comment-969434

--
Matt J. Sorenson [ emjayess ]
WEBJAX'd! || twitter.com/webjax
emjayess.net || twitter.com/emjayess

--
Matthew J. Sorenson (emjayess)
d.o. | g.d.o.

tbobker’s picture

I am using hostgator shared hosting. It is running php5 already. Is php 5 run as cgi not a module by default?

emjayess’s picture

If it was running as an Apache module, then Drupal's own default .htaccess file would take care of setting register_globals off, so my guess is it is running as CGI.

Well, at least, that is true for Drupal 6's .htaccess file... I don't recall if D5's .htaccess has the same conditionals... what version of Drupal are you running?

--
Matt J. Sorenson (emjayess)
d.o. | g.d.o. | WEBJAX'd! | twitter

--
Matthew J. Sorenson (emjayess)
d.o. | g.d.o.

emjayess’s picture

Also, did you confirm that it is, in fact, already running PHP5? Sometimes PHP5 is available, but PHP4 is still the default. I just read a hostgator FAQ entry that indicated this may be the case.

If you haven't done so, run a phpinfo(); page to confirm all the details of the environment.

--
Matt J. Sorenson (emjayess)
d.o. | g.d.o. | WEBJAX'd! | twitter

--
Matthew J. Sorenson (emjayess)
d.o. | g.d.o.