Re: mod_rewrite

From: hynek.lipa <hynek.lipa (zavinac)>
Date: 16. 12. 2005, 15:01 CET
Peter Krajčo napsal(a):
>     mam WIN XP sp2 naistalovany PHP Home 2, Apache 2.0.50, PHP 5.0.0. V konfiguracnom subore apache httpd.conf som si povolol nacitanie modulu: LoadModule rewrite_module modules/mod_rewrite.so. Chcel som skusit priklad z http://interval.cz/clanek.asp?article=3950
> a tak moj .htaccess obsahuje:
> RewriteEngine On 
> RewriteRule ^(.*)\.html$ %{DOCUMENT_ROOT}/index.php?stranka=$1 [L,QSA]
> index.php obsahuje:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
>  <title>Untitled</title>
> </head>
> <body>
>   firma
> </body>
> </html>
> ale ked kliknem na odkaz tak mi to vyhodi chybu: Object not found!, Error 404
> Moze niekto poradit kde je problem? Skusal som uz vsetko mozne....a stale to nefunguje
--------------------------------------

s rewritem jsem nedavno dost 'zapasil' a mam pocit, ze ve verzich Apache 
vyssich nez 2.0.47 je nejaky problem s pravidly v .htaccess. Pry staci, 
kdyz je v httpd.conf nastavena directiva
AllowOverride All
ale i tak mi to nechtelo prepisovat :(

zkus to nastavit ve virtual hostu, asi takto:

<VirtualHost *:80>
     ServerAdmin webmaster@test-rewrite
     DocumentRoot c:/cesta-do-rootu-webu
     ServerName test-rewrite

     RewriteEngine On

     RewriteCond %{REQUEST_URI} ^/(.*)\.html$
     RewriteRule ^/(.*)\.html$ %{DOCUMENT_ROOT}/index.php?$1 
[T=application/x-httpd-php,L,QSA]

</VirtualHost>

jeste ten odkaz ve strance by mel byt spis takto
...<a href="/firma.html">...
tedy s lomitkem na zacatku


enjoy;)
-h!-
Received on Fri, 16 Dec 2005 15:01:14 +0100

This archive was generated by hypermail 2.1.8 : 16. 12. 2005, 15:01 CET