Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Help PLE with /permalink/ to /page.aspx Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
clickfire
Newbie
Newbie


Joined: 25 June 2010
Location: United Kingdom
Online Status: Offline
Posts: 2
Posted: 25 June 2010 at 10:19am | IP Logged Quote clickfire

Hi Folks,

New to the forum and really struggling with a rule having just launched a new client website. The old website made use of /permalinks/ which I am struggling to re-direct:

Old URL is http://www.naturetrek.co.uk/wildlife-holidays-in-asia/

New URL is http://www.naturetrek.co.uk/wildlife_holidays_in_asia.aspx

I have been using the following rule...

RewriteCond Host: www\.naturetrek\.co\.uk
RewriteRule /wildlife-holidays-in-asia/ /wildlife_holidays_in_asia.aspx [I]

The problem is, it sucessfully finds and oads the .aspx page, BUT, all the dependent images, CSS files etc are not loaded because the rule still includes the redundant folder in the path (?) eg.

http://www.naturetrek.co.uk/wildlife-holidays-in-asia/images/logo.jpg

where the /wildlife-holidays-in-asia/ folder structure simply doesnt exist on the new site:-(

I know this is because we are using relative paths, but changing to absolute paths will be a mammoth task and not really an option.

I also know that use of the <base> tag will reslove my problem, but unfortunately introducing this tag screws up a whole bunch of stuff on the rest of the site.

I was hoping that someone with a better knowledge of the ISAPi Rewrite syntax could be provide with a better rule to get around this issue.

Thanks in advance for any help received.

Paul



__________________
http://www.clickfire.co.uk
Back to Top View clickfire's Profile Search for other posts by clickfire Visit clickfire's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 29 June 2010 at 7:43am | IP Logged Quote Anton

You may put the following rule to cut off the unnecessary part of the URL for pics/css:

RewriteRule /wildlife-holidays-in-asia(/.*/.+\.(?:jpg|gif|png|css|js)) $1 [I,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
clickfire
Newbie
Newbie


Joined: 25 June 2010
Location: United Kingdom
Online Status: Offline
Posts: 2
Posted: 29 June 2010 at 8:21am | IP Logged Quote clickfire

Hi Anton,

Many many thanks for your help - that worked straight away

Take a look http://www.naturetrek.co.uk/wildlife-holidays-in-asia/

Regards,

Paul

 



__________________
http://www.clickfire.co.uk
Back to Top View clickfire's Profile Search for other posts by clickfire Visit clickfire's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
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