You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Marc Collin <co...@laboiteaprog.com> on 2005/10/21 05:50:49 UTC
[users@httpd] mod_rewrite, .htaccess problem
hi
i try to to do overriding with apache
in my loadmodule.conf
LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so
in httpd.conf
<Directory />
Options None
AllowOverride All
Order deny,allow
Deny from all
</Directory>
# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
my .htaccess file
Options +FollowSymlinks
RewriteEngine on
ErrorDocument 404 /index
RewriteRule ^news([0-9]+)$ newssection.php?sec_nosection=$1 [L]
RewriteRule ^index$ index.php [L]
if i go to:
http://localhost/newssection.php?sec_nosection=1
that work fine...
but if i try
ttp://localhost/news1
i get:
Object not found!
The requested URL was not found on this server. The link on the
referring page seems to be wrong or outdated. Please inform the author
of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
error_log file
[Thu Oct 20 12:33:30 2005] [warn] Init: Session Cache is not configured
[hint: SSLSessionCache]
[Thu Oct 20 12:33:30 2005] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec2)
[Thu Oct 20 12:33:31 2005] [notice] Apache/2.0.54 (Linux/SUSE)
configured -- resuming normal operations
[Thu Oct 20 12:33:48 2005] [error] [client 127.0.0.1] File does not
exist: /srv/www/htdocs/favicon.ico
[Thu Oct 20 12:33:49 2005] [error] [client 127.0.0.1] File does not
exist: /srv/www/htdocs/news2, referer: http://localhost/
any idea?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] mod_rewrite, .htaccess problem
Posted by Joshua Slive <js...@gmail.com>.
On 10/20/05, Marc Collin <co...@laboiteaprog.com> wrote:
> in httpd.conf
>
> <Directory />
> Options None
> AllowOverride All
> Order deny,allow
> Deny from all
> </Directory>
>
> # use .htaccess files for overriding,
Why? Why aren't you just putting the directives directly in
httpd.conf (perhaps in an appropriate <Directory> section)? This
makes for less complications.
> AccessFileName .htaccess
> # and never show them
> <Files ~ "^\.ht">
> Order allow,deny
> Deny from all
> </Files>
>
> my .htaccess file
>
> Options +FollowSymlinks
> RewriteEngine on
> ErrorDocument 404 /index
>
> RewriteRule ^news([0-9]+)$ newssection.php?sec_nosection=$1 [L]
> RewriteRule ^index$ index.php [L]
>
> if i go to:
> http://localhost/newssection.php?sec_nosection=1
> that work fine...
>
> but if i try
>
> ttp://localhost/news1
>
> i get:
>
> Object not found!
Are there any other AllowOverride directives in httpd.conf or
Include'd files? Are you sure the .htaccess file is being read? Have
you tried putting in an obvious syntax error and making sure you get a
500 error from the server when you request the directory? Have you
tried the RewriteLog?
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org