|
||||||||||
|
|||||||
| GoogleCommunity Sponsor |
Use coupon "forum" for 50% Off! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Senior Googler
![]() Join Date: May 2007
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Help with URLRewriter
I am using UrlRewriter from urlrewriter.net and I wanted your help, how to build a rule that will help me resolve the following one:
/images-album/1/2/ ---> images.aspx?cat=1&pg=2 * 1 can be replaced with any number , 1 is where the category id is * 2 can be replaced with any numner, 2 is where the page number is pleae help.. |
|
|
|
|
Sponsored Links
|
|
|
|
#3 (permalink) |
|
Senior Googler
![]() Join Date: May 2007
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
<rewriteurl="image-galleries/some_category/([^/].*)"to="images.aspx?pg=$1"/>
i want only one parameter and that the page number but this code doesn't work and error when page loads please guide me Last edited by idansh; 07-30-2007 at 02:40 AM. |
|
|
|
|
|
#4 (permalink) |
|
Elite Googler
![]() Join Date: Oct 2006
Location: Ireland
Posts: 1,085
Thanks: 0
Thanked 2 Times in 2 Posts
![]() |
I'm not familiar with ASP, so it's hard to understand what that piece of code dose, but I know what you mean. Relative paths will cause problems with mod_rewrite, you should set a variable name in your index file, like:
$img_url=www.example.com/images/ and use it in html like: <img src="{$img_url}/myimage.jpg" /> If you understand what's happening with mod_rewrites: a) /images-album/1/2/ -> this is what you see in URL, it's a virtual url and it does not exist, so there are no folders /images-album/1/2/ on your server. b) images.aspx?cat=1&pg=2 -> this is where the actual script is being executed for this "virtual" url and your $img_url=www.example.com/images/ path should be ABSOLUTE, then you'll always get correct location. R@ |
|
|
|
|
|
#5 (permalink) |
|
Senior Googler
![]() Join Date: May 2007
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
so it makes things more complicated I've read an article here that says that all I should do is make the url of the images like in this form "~/..";
and everything would work fine, but it isn't any suggestion. you don't nee dto know asp , I will tel you that the '~' sign returns the servers root Any suggestions |
|
|
|
|
|
#7 (permalink) |
|
Elite Googler
![]() Join Date: Oct 2006
Location: Ireland
Posts: 1,085
Thanks: 0
Thanked 2 Times in 2 Posts
![]() |
Try this:
<rewriteurl="image-galleries/some_category/([^/].*)/"to="images.aspx?pg=$1"/> I haven't done url rewrites for the images and paths, because I think it's just very bad idea. I always use set image location in script and then pass it in html and never had any problems. So what's the problem with css and images? How are paths represented for them in HTML? Is it like "../myimage.jpg" -> you want to convert to "myimage.jpg" ??? You have to give me details where you're images are located and how actual paths in html look like and what path you need to convert it to.. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|