You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Nikos Gatsis <ni...@qbit.gr> on 2003/11/21 08:13:03 UTC

[users@httpd] Mod_rewrite problem

Hello list
Rewrite section does not work. What I'm I doing wrong?
An "file not found" error come out
I have v1.3.20 on 7.2 RH Linux

Thanx

<VirtualHost 193.58.186.229>
    ServerAdmin nikos@qbit.gr
    DocumentRoot /home/http/nikos/horc
        RewriteEngine On
        RewriteRule ^/atricles/([^/]+)/([^/]+)/([^/]+)\.html$
/contents/profil.htm [R]
    <Directory /home/http/nikos/horc/contents/files>
        Options None
    </Directory>
    ServerName www.horc.gr
    ErrorLog /home/http/nikos/horc/horc_error_log
    CustomLog /home/http/nikos/horc/horc_access_log common
        RewriteLogLevel 1
        RewriteLog /home/http/nikos/horc/rewrite_log
</VirtualHost>



---------------------------------------------------------------------
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 problem

Posted by Wouter van Vliet <wo...@springt.nl>.
> -----Oorspronkelijk bericht-----
> Van: Wouter van Vliet [mailto:wouter@springt.nl]
> Verzonden: vrijdag 21 november 2003 10:29
> Aan: users@httpd.apache.org
> Onderwerp: RE: [users@httpd] Mod_rewrite problem
>
>
> Two things:
>
> 1) check the spelling of "articles", that seems messed up
> 2) why do you have three ([^/]+) blocks in it, while you're not doing
> anything with it? Think you can just do
> 	RewriteRule ^/articles.*\.html$	/contents/profil.htm
>
> to gain the same benefit. Unless you are GOING to do something with those
> thingies that have a name I cannot recall at this moment. Further, unless
> you want to users to verbosively redirect to the new url, the [R] is not
> needed. It's usually just used when some resource is permanently or
> temporarily moved. Or for redirecting to another server.
>
> Hope it helped you.

STOP THE PRESSES !!

there's something else, without the RewriteBase directive every 'rewrite
target' should be absolute from the server's root dir. Change the most
appropriate thing to:

/path/to/your/document_root/contents/profil.htm

>
> Wouter
>
> > -----Oorspronkelijk bericht-----
> > Van: Nikos Gatsis [mailto:nikos@qbit.gr]
> > Verzonden: vrijdag 21 november 2003 8:13
> > Aan: users@httpd.apache.org
> > Onderwerp: [users@httpd] Mod_rewrite problem
> >
> >
> > Hello list
> > Rewrite section does not work. What I'm I doing wrong?
> > An "file not found" error come out
> > I have v1.3.20 on 7.2 RH Linux
> >
> > Thanx
> >
> > <VirtualHost 193.58.186.229>
> >     ServerAdmin nikos@qbit.gr
> >     DocumentRoot /home/http/nikos/horc
> >         RewriteEngine On
> >         RewriteRule ^/atricles/([^/]+)/([^/]+)/([^/]+)\.html$
> > /contents/profil.htm [R]
> >     <Directory /home/http/nikos/horc/contents/files>
> >         Options None
> >     </Directory>
> >     ServerName www.horc.gr
> >     ErrorLog /home/http/nikos/horc/horc_error_log
> >     CustomLog /home/http/nikos/horc/horc_access_log common
> >         RewriteLogLevel 1
> >         RewriteLog /home/http/nikos/horc/rewrite_log
> > </VirtualHost>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
>
>
>
>
> ---------------------------------------------------------------------
> 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




---------------------------------------------------------------------
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 problem

Posted by Wouter van Vliet <wo...@springt.nl>.
Two things:

1) check the spelling of "articles", that seems messed up
2) why do you have three ([^/]+) blocks in it, while you're not doing
anything with it? Think you can just do
	RewriteRule ^/articles.*\.html$	/contents/profil.htm

to gain the same benefit. Unless you are GOING to do something with those
thingies that have a name I cannot recall at this moment. Further, unless
you want to users to verbosively redirect to the new url, the [R] is not
needed. It's usually just used when some resource is permanently or
temporarily moved. Or for redirecting to another server.

Hope it helped you.

Wouter

> -----Oorspronkelijk bericht-----
> Van: Nikos Gatsis [mailto:nikos@qbit.gr]
> Verzonden: vrijdag 21 november 2003 8:13
> Aan: users@httpd.apache.org
> Onderwerp: [users@httpd] Mod_rewrite problem
>
>
> Hello list
> Rewrite section does not work. What I'm I doing wrong?
> An "file not found" error come out
> I have v1.3.20 on 7.2 RH Linux
>
> Thanx
>
> <VirtualHost 193.58.186.229>
>     ServerAdmin nikos@qbit.gr
>     DocumentRoot /home/http/nikos/horc
>         RewriteEngine On
>         RewriteRule ^/atricles/([^/]+)/([^/]+)/([^/]+)\.html$
> /contents/profil.htm [R]
>     <Directory /home/http/nikos/horc/contents/files>
>         Options None
>     </Directory>
>     ServerName www.horc.gr
>     ErrorLog /home/http/nikos/horc/horc_error_log
>     CustomLog /home/http/nikos/horc/horc_access_log common
>         RewriteLogLevel 1
>         RewriteLog /home/http/nikos/horc/rewrite_log
> </VirtualHost>
>
>
>
> ---------------------------------------------------------------------
> 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
>




---------------------------------------------------------------------
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