httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Warwick" <mwarw...@stwgtn.co.nz>
Subject RE: [users@httpd] Simple URL redirection (mod_rewrite)
Date Wed, 04 Sep 2002 22:18:59 GMT
Try:

RewriteEngine on
RewriteBase /somedir/help
RewriteRule ^/somedir/help/(.*)$ /somedir/help/index.php?on=$1

I'm not sure if you would need the RewriteBase directive. The $ at the
end of the match string forces the rewrite module to include all
characters until the end and the ^ character means start the match at
the start (i.e. immediately after the domain name)

Another way to do this without using rewrites would be to use a help.php
script and the directives
Options +multiviews
AcceptPathInfo On
then use php to extract the rest of the path.

-----Original Message-----
From: Iván Vega Rivera [mailto:ivan@i-sol.biz]
Sent: Thursday, 5 September 2002 9:28 a.m.
To: users@httpd.apache.org
Subject: [users@httpd] Simple URL redirection (mod_rewrite)


Hi,

I'm trying to get Apache to rewrite URLs based on this simple need:

convert this: /somedir/help/chat
to this: /somedir/help/index.php?on=chat

I want to use an .htaccess file on /somedir/help, but I can't seem to
find the proper config for mod_rewrite... I've tried with this (remember
its under /somedir/help):

RewriteEngine on
RewriteBase /somedir/help
RewriteRule ^/(.*) index.iss?on=$1

But when I try to open /somedir/help/chat (which of course doesn't exist
physically), I get a 404.

I've already searched the web for examples on mod_rewrite, and I found
plenty, but I can't understand them! :( I also tried to read the
documentation of the module (no further comments...)

Can somebody please help me solve this apparently simple issue?

Thanks in advance.

Ivan V.





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


Mime
View raw message