cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
New

forwarding with .htaccess - need specific help

I published an e-book which has dozens of embedded links in it, all in this format:

 

http://myurl.com/videos/#v60

 

(myurl.com is hosted at GoDaddy using Managed Wordpress, and #v60 is an anchor to video number 60 on that page.)

 

This seems to work flawlessly for most people. However, I just had one buyer of the book who is annoyed that the links lead to a 404 page. I asked him for a screenshot, and it appears -- for some reason -- that the URL in the bar is this:

 

http://myurl.com/videos/%23v60

 

I checked my raw EPUB and MOBI files for the ebook, and they're both fine, so my only conclusion is that his reader is doing something funky with the # sign and converting it to %23.

 

So I thought -- what if I go into the htaccess file and write a custom forwarder to take someone from the bad URL (the second one) to the first?

 

I wrote this into my htaccess file:

 

Redirect /videos/%23v60 http://myurl.com/videos/#v60

 

But it doesn't work. If I go to the bad URL (http://myurl.com/videos/%23v60) I get an error 404.

 

Any tips on writing the URL redirection properly?

 

2 REPLIES 2
Helper VI
Helper VI

Re: forwarding with .htaccess - need specific help

@ddas can you check this?

 

RewriteRule ^/?videos/(.*?)/ ^/?videos/${unesc:$1} [R,L,NE,NC]

 

Hope it helps!

 

If you find my replies helpful, give me a like or kudo Smiley Happy
And if I solved your issue, mark it as solution Smiley Very Happy
New

Re: forwarding with .htaccess - need specific help

I tried it and it didn't work. Sorry...

 

Small note: in my real site the word is not actually "videos" -- it's three words separated by hyphens and a digit afterwards. So in trying your solution, I replaced "videos" with the actual string. For illustrative purposes, pretend the string is "all-videos-page-4" -- I wrote this into my htaccess:

 

RewriteRule ^/?all-videos-page-4/(.*?)/ ^/?all-videos-page-4/${unesc:$1} [R,L,NE,NC]

 

Let me know if I did that wrong.