Forum Moderators: phranque
I just got installed apache 2 and now i try to make my news system work with mod_rewrite.
But everytime i type file.html -> it comes only 404 (file not found) instead of file.php
i have many files in the same folder which are php files and i want the user type file.html but get a php executed: e.x. you type news293.html -> get news.php?news=293 Or simply dslnews.html -> dslnews.php
i have my .htaccess where all my files are:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^dslnews\.html$ dslnews.php [L]
RewriteRule ^dsltarife\.html$ dsltarife.php [L]
RewriteRule ^rdf\.rdf$ rdf.php [L]
RewriteRule ^volumentarife\.html$ volumentarife.php [L]
RewriteRule ^zeittarife\.html$ zeittarife.php [L]
RewriteRule ^flattarife\.html$ flattarife.php [L]
RewriteRule ^index\.html$ index.php [L]
RewriteRule ^newsticker\.html$ nticker.html [L]
RewriteRule ^news([0-9]{4}-[0-9]{2}-[0-9]{2})\.html$ news.php?news=$1 [L]
RewriteRule ^provider([0-9]{4}-[0-9]{2}-[0-9]{2})\.html$ provider.php?provider=$1 [L]
RewriteRule ^volumentarife_detail([0-9]{4}-[0-9]{2}-[0-9]{2})\.html$ volumentarife_detail.php?tarif=$1 [L]
RewriteRule ^zeittarife_detail([0-9]{4}-[0-9]{2}-[0-9]{2})\.html$ zeittarife_detail.php?tarif=$1 [L]
RewriteRule ^flattarife_detail([0-9]{4}-[0-9]{2}-[0-9]{2})\.html$ flattarife_detail.php?tarif=$1 [L]
RewriteRule ^archiv([0-9]{4}-[0-9]{2}-[0-9]{2})\.html$ archiv.php?kat=$1 [L]
RedirectMatch ^/forum/forumdisplay/f-([a-zA-Z0-9_-]*).html$ /forum/archive/index.php/f-$1 [L]
RedirectMatch ^/forum/showthread/t-([a-zA-Z0-9_-]*).html$ /forum/archive/index.php/t-$1 [L]
and my httpd.conf
# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
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>
Please help me!
THANKS!
Welcome to WebmasterWorld [webmasterworld.com]!
You will not be able to use mod_rewrite with AllowOverride set to "None". I suggest you set it to "All" and then remove overrides until you have problems.
You will need at least AllowOverride FileInfo Options to use your code as posted.
See the Apache documentation of AllowOverride [httpd.apache.org] for more information.
Jim