Forum Moderators: phranque

Message Too Old, No Replies

Apache Mod Rewrite

New To Mod Rewrite, Need help

         

sridevi_b

10:45 am on Jul 31, 2004 (gmt 0)



Hello All,
I am new to Apache Mod Rewrite concept. Can any body explain how can we use it? I tried a small example.
I have two pages index.php and fpwd.php. In index.php there is a link to fpwd.php. After submiting email id then it will redirect to index page. And the url is "www.domain.com/subfolder/index.php?msg=fpwd". Then a message pops up that password has emailed to you. For this i want to implement mod rewrite. Presently i am writing like this.

Options +FollowSymLinks
RewriteEngine on
RewriteOptions inherit
RewriteBase "C:/root/sridevi/"

RewriteCond %{QUERY_STRING} ^msg=fpwd$
RewriteRule ^index\.php$ index/fpwd/ [R=301,L]

Is it correct way of using mod rewrite. Please explain how to implement for this issue.

Thanks & Regards,
Sridevi.

jdMorgan

11:58 pm on Aug 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



sridevi_b,

Welcome to WebmasterWorld [webmasterworld.com]!

If I understand what you're trying to do, you want to use a link of "fpfwd.php" to access your script at index.php with a query string of "msg=fpfwd".

In that case, you'd use:


RewriteRule fpwd\.php$ /subfolder/index.php?msg=fpwd [L]

The code you posted does the opposite.

Jim