3868 posts
  • Has been part of the Envato Community for over 7 years
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+9 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
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 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
  • Has been part of the Envato Community for over 7 years
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+9 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
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 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
  • Has been part of the Envato Community for over 7 years
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+9 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
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Had an item featured on Envato Market
+5 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
  • Has been part of the Envato Community for over 7 years
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+9 more
flashjunkie says

WickedPixel, I love you!

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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by