Hi all,
I can't make Drupal Clean URLs work under Apache 2-0-48. I get HTTP 500 if I use .htaccess (where I'm using clause.
I suspect something is wrong with mod_rewrite.
Could please someone send me an example of a working .htaccess under Apache 2, just to compare with mine ?? How can I check if rewrite support is configured well with my ISP ??
Thanks to all for your kind help

Matteo

Comments

marky’s picture

I'm successfully running clean urls and Apache2 on Windows. Apache2 requires you change the .htaccess from the default. This was my only change:

# Overload PHP variables:
#<IfModule mod_php4.c>
<IfModule sapi_apache2.c>
   # If you are using Apache 2, you have to use <IfModule sapi_apache2.c>
   # instead of <IfModule mod_php4.c>.
   php_value register_globals        0
   etc...

/marky

matteo’s picture

Thanks, but what about mod_rewrite support; do you have to change any other part of .htaccess because of mod_rewrite ??
I cannot see Apache log, so I'm wondering what's goin on...

Matteo
mailto:webmaster@cantincoro.org

marky’s picture

The above was my only change to .htaccess. Is mod_rewrite listed as loaded if you do:

print_r(apache_get_modules());

/marky

Alexandre Gomes@drupal.poderdapalavra.com.br’s picture

I had this problem also, just comment the first commands of htaccess (that who prevent eyes (including you) and the symlinks.

Aress’s picture

When I installed Drupal I got the 500 error, then I changed some value in .htaccess (look the post below Options in .htaccess, http://drupal.org/node/view/8538 ). Do you use Aruba ?
Ciao, Aress

matteo’s picture

I had the same problem, on Aruba provider.
After some trials, I eliminated HTTP 500 error.
here is .htaccess I'm using
Hope it help
Matteo

#
# Apache/PHP/site settings:
#

# Protect files and directories from prying eyes:
<Files ~ "(\.(conf|inc|module|pl|sh|sql|theme)|Entries|Repositories|Root|scripts|updates)$">
  order deny,allow
  deny from all
</Files>

# Customized server error messages:
ErrorDocument 404 /index.php

# Overload PHP variables:
<IfModule sapi_apache2.c>
   php_value register_globals        0
   php_value track_vars              1
   php_value short_open_tag          1
   php_value magic_quotes_gpc        0
   php_value magic_quotes_runtime    0
   php_value magic_quotes_sybase     0
   php_value arg_separator.output    "&amp;"
   php_value session.cache_expire    200000
   php_value session.gc_maxlifetime  200000
   php_value session.cookie_lifetime 2000000
   php_value session.auto_start      0
   php_value session.save_handler    user
   php_value session.cache_limiter   none
   php_value allow_call_time_pass_reference  On
</IfModule>

# Various rewrite rules
#<IfModule mod_rewrite.c>
<IfModule mod_rewrite.c>

  RewriteEngine on

  # Modify the RewriteBase if you are using Drupal in a subdirectory and the
  # rewrite rules are not working properly:
  RewriteBase /

  # Rewrite old-style URLS of the form 'node.php?id=x':
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^id=([^&]+)$
  #RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x':
  #RewriteCond %{REQUEST_FILENAME} !-f
  #RewriteCond %{REQUEST_FILENAME} !-d
  #RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
  #RewriteRule module.php index.php?q=%1 [L]

  # Rewrite URLs of the form 'index.php?q=x':
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
Aress’s picture

I made the same modification commentig some options, now it works but the question of the other post remains: can these changes create problems with some modules?
With aruba are there also other problems: php is installed as CGI and not as module so all the stuff that follows "# Overload PHP variables: " is useless IMHO. And there aren't other ways to change these parameters but it's better to ask on aruba forum.

P.S. to access to log with aruba write http://yourdomain/login

Aress’s picture

[quote]And there aren't other ways to change these parameters[/quote].

There is a way: instead of .htaccess you can use write php options in a file called php.ini:

register_globals = 0
track_vars = 1
short_open_tag = 1
magic_quotes_gpc = 0
magic_quotes_runtime = 0
magic_quotes_sybase = 0
arg_separator.output = "&"
session.cache_expire = 200000
session.gc_maxlifetime = 200000
session.cookie_lifetime = 2000000
session.auto_start = 0
session.save_handler = user
session.cache_limiter = none
allow_call_time_pass_reference = On

Cheers, Mike

afagioli’s picture

now aruba gives a very handy "PHP.INI file customization - Select the PHP.INI which betters suits the applications to set in your own web space." page [http://webx143.aruba.it/CP/index.php?ak=phpini_override] where you can select a Drupal customisation php.ini . Cool!