3868 posts
  • 8 Years of Membership
  • Affiliate Level 5
  • Author Level 5
  • Beta Tester
+10 more
flashjunkie
says

Hi guys,

Having looked at this page my jaw hit the desk – http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Way too complicated for my simple mind!

I’m basically wanting to rewrite urls to find and replace a # symbol with #! but obviously if the #! is present then leave it as it is… can ANYONE help me with this?

Jay

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says

Hm, from what I know… the hash part of the url is not parsed by the serverside engine. That is a client-side job. js and such. For handling hash jobs I use the jQuery Address plugin…

3868 posts
  • 8 Years of Membership
  • Affiliate Level 5
  • Author Level 5
  • Beta Tester
+10 more
flashjunkie
says

I’m rewriting my site to use #! over # for SEO reasons, but any existing links to our deeplinked content will then default to the homepage, I need a way to rewrite old URL ’s containing only the # to #! BEFORE swfaddress gets it’s hands on the URL … Argh! – Can anyone help?

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says

I think you only need to make a change in your script before handling the path… search for the ! character and if it’s not existent… simply add it. :)

3868 posts
  • 8 Years of Membership
  • Affiliate Level 5
  • Author Level 5
  • Beta Tester
+10 more
flashjunkie
says

I tried to do that in AS3 , but the problem is that swfaddress empties the hash fragment before flash can check it…

Demo – http://tpet.co.uk/#!/About – works fine, but if you visit… http://tpet.co.uk/#/About it will clear the fragment and THEN flash’s first view of it is empty so it pushes the user to the home page… :|

3072 posts
  • Affiliate Level 3
  • Author Level 6
  • Collector Level 2
  • Weekly Top Seller
+7 more
wickedpixel
says

Well.. just add in the html page another small js script to change the hash path in case it’’s incorrect. it needs to be added before the swfaddress script…
Can be something like this: http://pastie.org/4574209

3868 posts
  • 8 Years of Membership
  • Affiliate Level 5
  • Author Level 5
  • Beta Tester
+10 more
flashjunkie
says

WickedPixel, I love you!

Works EXACTLY as I needed to, such a simple solution, thank you so much!

by
by
by
by
by
by