Forum Moderators: phranque

Message Too Old, No Replies

Rewrite Rule

Rewrite Rule

         

isas_n

8:36 am on Jun 16, 2004 (gmt 0)

10+ Year Member



Dear Sir,

Please provide me ideas in creating the rule.

1.
If the URL is,
[103.103.16.103:82...] ....

It should go to UserDetails.php, by checking the querystring userid=6786.

2.
If the URL is,
[103.103.16.103:82...]

It should not go to the UserDetails.php, insted it should display the index.htm file located in the above mentioned subfolder.

I tested with the forum link,
[webmasterworld.com...]

but I was not getting the proper response.

--------
As per this Rule,

RewriteRule ^/courses/([^\/]+/[^/\]+/.+)$ /UserDetails.php?page_request=$1 [QSA]

I was getting what I needs, but I was not getting any images included in that index.htm file.

--------

Regards,
Sasikumar

jdMorgan

2:08 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sasikumar,

Welcome to WebmasterWorld [webmasterworld.com]!

I was getting what I needs, but I was not getting any images included in that index.htm file.

Your rule redirected the requests for the image files to your script, and your script did not know what to do with those image requests. To avoid this problem, you can change your rule to redirect .htm file requests only:


RewriteRule ^/courses/([^/]+/[^/]+/.+[b]\.htm[/b])$ /UserDetails.php?page_request=$1 [L]

Jim

isas_n

4:50 am on Jun 22, 2004 (gmt 0)

10+ Year Member



Thanks a Lot Jim.

The Rule was working for my expectation.