3868 posts
  • Author had a Free File of the Month
  • Beta Tester
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 7-8 years
+4 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

3069 posts
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
  • Romania
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
  • Author had a Free File of the Month
  • Beta Tester
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 7-8 years
+4 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?

3069 posts
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
  • Romania
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
  • Author had a Free File of the Month
  • Beta Tester
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 7-8 years
+4 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… :|

3069 posts
  • Has been a member for 6-7 years
  • Won a Competition
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
  • Exclusive Author
  • Romania
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
  • Author had a Free File of the Month
  • Beta Tester
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 7-8 years
+4 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