Forum Moderators: phranque

Message Too Old, No Replies

A + symbol appears in url in the 404 error log

solution to redirect using .htaccess

         

orasis

1:27 pm on Mar 13, 2012 (gmt 0)

10+ Year Member



Hi this is happening a while now, I get in the 404 error log this:

images/podcast/electronic-music+_podcast_200x200.jpg

please notice the + there, well the real image url is without that +

images/podcast/electronic-music_podcast_200x200.jpg

I have no idea what caused this to some website and it hits our podcast with this wrong url, but I cannot think of a way to redirect it to the proper using .htaccess.

any help greatly appreciated
thanks

lucy24

6:16 pm on Mar 13, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Does it say where it's linking from? If it's your own link, fix and redirect. If it's someone else's malformed link, ### 'em. Don't waste time redirecting wrong links from outside. Unless it's a link that you suffered and struggled to win, and then they go and misspell it ;)

If your URLs never really contain plusses-- which they shouldn't-- redirecting should be easy. The underlying pattern is

([^+]+)\+([^+]+) becomes $1$2

... and cross your fingers and hope you don't get requests for things with multiple plusses or you're talking php-script-rewrite. But again, only if they're your own links.

orasis

6:50 pm on Mar 13, 2012 (gmt 0)

10+ Year Member



lucy24 my friend thank you for answering.

It is not own link error no, for sure.

I went some time ago and submitted a friend's podcast rss to various of podcast directories (well not that many once they are not that many anyway). Most of them asked, except the podcast rss url, a podcast image url (same happens on itunes). I doubt I pasted wrong, once I had made a txt and was copy/pasting urls, I doubt I put a + there myself.

To be honest, I didn't check to see where it comes from, I saw the error in the Joomla backend using a simple plugin for 404s that doesn't show referrer.

So, thanks for this pattern, I will add it right away now and lets see :)

thanks man
peace

orasis

6:53 pm on Mar 13, 2012 (gmt 0)

10+ Year Member



ups, forgot to ask, how do I use this in .htaccess ?
I am not that expert to imagine it sorry ! :)

lucy24

8:00 pm on Mar 13, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'll be using mod_rewrite. Spend some time with the documentation [httpd.apache.org] and also read some threads in this forum. Any random thread will do.

When you think you've got it, come back. The Apache forum always makes you try it yourself first, even if someone could write the code for you in 1/10 the time ;)

orasis

8:13 pm on Mar 13, 2012 (gmt 0)

10+ Year Member



I am sure it's got to do with mod_rewrite.
if it's a big secret I got no problem :)
I am not born to beg anyone around me. heh

cheers

g1smd

9:44 pm on Mar 13, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It may be there was an unwanted space in the URL at some point. Some systems will replace the space with a plus symbol.

orasis

9:57 pm on Mar 13, 2012 (gmt 0)

10+ Year Member



yeah this is what I thought at first.
I will make some tests and try to put some imagination in how to setup this part of code in .htaccess on my local linux to make it faster.

g1smd, thanks for your reply, I appreciate too.

I don't dare to ask anyone else to help once I don't want it to be considered begging for code writing. I really don't care from now on.