Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting URLs

Status
Not open for further replies.

gxpark

Programmer
Aug 10, 2002
19
MX
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.
 
Ok, so I can do this:

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

And if I go to /somedir/help/chat/here I get /somedir/help/index.php?on=/here

It appears I'm getting close...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top