View Full Version : A trouble with .htaccess
jeanjacquesjeanjacques
7th December 2006, 20:49
Hi Guys,
I don't understand why but i'm trying to create an .htaccess file with the following content:
ptions -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ ./index.php [L]
All i get in return is an error 500.
Do you have an idea of i'm doing wrong ?
Any help would be really appreciated.
Thanks
jnsc
7th December 2006, 21:59
Replace
ptions -Indexes
with
Options -Indexes
But you can also check you apache error logs
jeanjacquesjeanjacques
7th December 2006, 22:28
Hi,
Well sorry i've made a mistake when i copy/pasted, this is the real content of the .htaccess:
Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ ./index.php [L]
I still get an error 500.
I don't really understand because the error is not in the error.log.
I tried cat /var/log/apache/error.log | grep mydomain.com
Any suggestion ?
jnsc
7th December 2006, 22:43
I think in this case tail /var/log/apache/error.log is a better choice
Look if your AllowOverride Directive is allowing you to use this directives in this directory.
http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride
jeanjacquesjeanjacques
7th December 2006, 23:12
Hi Jnsc,
Thanks for the advice.
I've changed my httpd.conf with this directive:
#
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride all
I restarted apache but i still get this error 400...
i really don't understand.
jnsc
7th December 2006, 23:25
what is the output of tail /var/log/apache/error.log
jeanjacquesjeanjacques
7th December 2006, 23:31
Here it is:
hulk:/home/www/web40/log# tail /var/log/apache/error.log
[Thu Dec 7 22:01:32 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Thu Dec 7 22:10:21 2006] [notice] SIGHUP received. Attempting to restart
[Thu Dec 7 22:10:21 2006] [notice] Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 configured -- resuming normal operations
[Thu Dec 7 22:10:21 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Thu Dec 7 22:14:51 2006] [notice] SIGHUP received. Attempting to restart
[Thu Dec 7 22:14:51 2006] [notice] Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 configured -- resuming normal operations
[Thu Dec 7 22:14:51 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Thu Dec 7 22:21:38 2006] [notice] SIGHUP received. Attempting to restart
[Thu Dec 7 22:21:38 2006] [notice] Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-16 configured -- resuming normal operations
[Thu Dec 7 22:21:38 2006] [notice] Accept mutex: sysvsem (Default: sysvsem)
hulk:/home/www/web40/log#
jnsc
8th December 2006, 00:08
and
tail /home/www/web40/log/error.log
jeanjacquesjeanjacques
8th December 2006, 08:55
Here is the output
hulk:~# tail /home/www/web40/log/error.log
[Thu Dec 7 21:40:01 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/golf-channel
[Thu Dec 7 21:40:02 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/favicon.ico
[Thu Dec 7 21:40:05 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/favicon.ico
[Thu Dec 7 21:42:43 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/favicon.ico
[Thu Dec 7 21:42:44 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/favicon.ico
[Thu Dec 7 21:42:50 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/favicon.ico
[Thu Dec 7 21:54:53 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/favicon.ico
[Thu Dec 7 21:54:55 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/golf-cart
[Thu Dec 7 21:57:51 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/golf-equipment
[Thu Dec 7 22:00:24 2006] [error] [client 88.160.48.159] File does not exist: /home/www/web40/web/golf-play
I don't understand i can't see the error 400 in there
jnsc
8th December 2006, 10:16
Is it now an error 400 or still 500, because it's a different one
jeanjacquesjeanjacques
8th December 2006, 10:28
Hello,
I feel a little bit stuck, is there someone who encountered this kind of error ?
best regards,
falko
8th December 2006, 16:23
What about jnsc's question?
Then, have a look at this thread: http://www.howtoforge.com/forums/showthread.php?t=38&highlight=drupal+.htaccess
jeanjacquesjeanjacques
9th December 2006, 12:36
Hello Falko,
Now i get this error message
Bad Request
Your browser sent a request that this server could not understand.
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.33 Server at www.mydomain.com Port 80
And here is the content of the apache directives for this website:
Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ ./index.php [L]
jeanjacquesjeanjacques
9th December 2006, 12:47
Hi,
I've tried something else, instead of inserting the content of the .htaccess file thanks to the web interface inside the apache directives section i've created the file .htaccess.
The file .htaccess has been uploaded to the root directory but now i get this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@mydomain.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
falko
9th December 2006, 15:04
Anything in Apache's error log?
Can you try
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
</IfModule>
in your .htaccess file?
jeanjacquesjeanjacques
9th December 2006, 15:19
Hello,
It works now :)
I've deleted everything inside the apache directives section. I created a .htaccess file that i uploaded inside the root folder of the website.
Now it works fine,
Thanks for your help guys.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.