This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Rewrites to a directory
Author
Message |
Jennifer Marx
Newbie


Joined: 18 October 2010
Posts: 4
Posted: 18 October 2010 at 12:39pm

I have a software update that now includes rewrite codes. The codes are meant
to be placed with the software in my root, but long ago I placed the software
in a directory and the httpd.ini file in the directory doesn't work. My web host
tells me that ISAPI 2 (which is what I have installed) does not recognize
httpd.ini files in directories. So I need to know how to modify the rewrite
codes so they can work in the root httpd.ini file. Here's the code I have right
now:

Code:
RewriteRule ^(.*)/p([0-9]+)-(.*).html$ showphoto.php?photo=$2
[L]


I think I need to specify the directory on a line above this code if I'm putting it
in the root, right? I tried this:

Code:
RewriteCond URL ^/photos/.*
RewriteRule ^(.*)/p([0-9]+)-(.*).html$ showphoto.php?photo=$2 [L]


... but it didn't work.

How do I do this correctly?

For example, I want this url:
Code:
http://www.passporter.com/photos/hollywood/p22162-
dream.html


... to display this url:

Code:
http://www.passporter.com/photos/showphoto.php?
photo=22162
Back to Top
 
Jennifer Marx
Newbie


Joined: 18 October 2010
Posts: 4
Posted: 18 October 2010 at 1:01pm

Just posting to say I figured it out. I simply changed the code to this:

Code:
RewriteRule /photos/(.*)/p([0-9]+)-(.*).html$
/photos/showphoto.php?photo=$2 [L]


And it works great. :)
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum