Lunarpages Web Hosting Forum

Author Topic: URL rewrite  (Read 3302 times)

Offline sureshmulagala

  • Spaceship Captain
  • *****
  • Posts: 116
    • http://www.shopperbag.com
URL rewrite
« Reply #15 on: March 08, 2004, 07:05:29 AM »
steve..would u be able to take one more question relating to the above? hope im not asking too much.... :wink:
Bid, Buy or Sell for Free
www.shopperbag.com

Priest

  • Guest
URL rewrite
« Reply #16 on: March 08, 2004, 07:12:35 AM »
no, what's up?

Offline sureshmulagala

  • Spaceship Captain
  • *****
  • Posts: 116
    • http://www.shopperbag.com
URL rewrite
« Reply #17 on: March 08, 2004, 07:22:17 AM »
i have this following hirearchy

im having a wee bit of trouble, cuz im on windows and its different when it goes off on live on unix...

i cant even test it with .htaccess

on my local i have

c:\resin\doc\jsp          <--jsps go in here
c:\resin\doc\jsp\pics     <-- images go in here
c:\resin\doc\css          <-- css go in here
c:\resin\doc\js           <-- js go in here
c:\resin\doc\html         <--html go in here

on the live, i have something like

public_html\jsp          <--jsps go in here
public_html\jsp\pics     <-- images go in here
public_html\css          <-- css go in here
public_html\js           <-- js go in here
public_html\html         <--html go in here


so normally, the live would point like this:

http://mydomain.com/jsp/mainpage.jsp

and navigate to different subpages as:

http://mydomain.com/jsp/subpage.jsp?id=xxx

since we've masked the url to show something like

http://mydomain.com/categories/category23.html

any links resulting in this page would default to

http://mydomain.com/categories/xxxxx.html instead of looking to the root...

i have my "pics" folder in the "jsp" folder so used the images like pics/image.gif

now it wants all the files to be in categories folder....i dont know if its something to do
with the windows or its different on unix...since the root is defaulted to
"http://mydomain.com/categories"....do i have to remap all the paths in all the jsp files?

im prepared to bite the bullet...but just wanted to know before i start changing starting from page 1 to page 100...if youve got ideas, it might save me 10 man days....  :roll:

since all the jsps are in the jsp folder, all the links in the jsp look into the local folder, so i had to just give the link as <a href="page.jsp">go to page</a> , so obviously in this situations its lookign for /categories/page.jsp which its failing on.....
Bid, Buy or Sell for Free
www.shopperbag.com

Priest

  • Guest
URL rewrite
« Reply #18 on: March 08, 2004, 07:27:59 AM »
Really the only idea I have since the URL has been re-written is to change pics/image.gif to /jsp/pics/image.gif, using the absolute value instead of a relative value.

Course I've been awake for about 36 hours now and am kinda delirious, some other perl guru might be able to come in and tell you the easy way to do it, that's the only advice I have for ya though  :(

Offline sureshmulagala

  • Spaceship Captain
  • *****
  • Posts: 116
    • http://www.shopperbag.com
URL rewrite
« Reply #19 on: March 08, 2004, 07:34:30 AM »
no problems....u get some sleep now.....laterz....

thanks and thanks a lot...i greatly appreciate your help
Bid, Buy or Sell for Free
www.shopperbag.com

Offline Ripta

  • Master Jedi
  • *****
  • Posts: 1271
URL rewrite
« Reply #20 on: March 08, 2004, 06:47:56 PM »
I didn't quite follow this from the beginning, but if all images you're using are under the /jsp/pics, you could add another line in the htaccess:

Code: [Select]

RewriteRule ^categories\/(.+)\.gif$ /jsp/$1


which would turn requests for /categories/pics/image.gif into /jsp/pics/image.gif. :thumb:
GetAFreelancer! (This service is not affiliated with Lunarpages)