Forum Moderators: phranque

Message Too Old, No Replies

Messy URL and need to change

Long URL and 500 error message needs to be removed.

         

rajnvr

2:35 am on Mar 24, 2012 (gmt 0)

10+ Year Member



Hi Everyone-

I'm a newbie to this forum. i need your help.

I have received 500 error due to the following url.

http://www.example.com/my-account-panel/my-account.raw?view=sendcontact&pagelink=L3JlYW&propid=817&owneremail=

I need to rewrite the above url to
http://www.example.com

How can i do that in .htaccess file?

Thanks in advance.

lucy24

6:53 am on Mar 24, 2012 (gmt 0)

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



An URL by itself can't cause a 500 error. A 500 means the server is unhappy about something, most likely the wording of htaccess. (Been there. Done that.) If this is the only URL that triggers the error, then I would look at any RewriteCond attached to a RewriteRule affecting only this URL.

Also look at the script that handles query strings. Is it getting upset because of that trailing "owneremail=" nothing? Usually scripts can handle empty parameters.

Now then... You say "rewrite" but I strongly suspect you mean "redirect". Do you want the user's address bar to change?

Is it only that one specific URL that has to get rewritten/redirected? Or is there some pattern that you want to get rid of?

Be careful about redirecting too many different pages to the home page. You may want a brutal 410 instead.

And now...

Let's see what you've come up with so far. Maybe the 500 error will jump up and hit someone in the face.

phranque

9:25 am on Mar 24, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



if you have a 500 status code response there will be a corresponding error message in your server error log.

rajnvr

12:05 pm on Mar 24, 2012 (gmt 0)

10+ Year Member



@lucy24-

Yes I would like to redirect based on the pattern "pagelink=L3JlYW". There are bunch of urls are giving this error.

Thanks

rajnvr

2:46 pm on Mar 24, 2012 (gmt 0)

10+ Year Member



@phranque Yes. I did see message in server log like below

View not found [name, type, prefix]: sendcontact,html,plView

rajnvr

11:23 pm on Mar 24, 2012 (gmt 0)

10+ Year Member



Thanks everyone. The issue is resolved after identifying the missing view. Thanks phranque. Here i have another challenge.

I have a url ends with %20target and i want to remove

for example my url is
http://www.example.com/sub1/sub2/14.html%20target=

i want to redirect to
http://www.example.com/sub1/sub2/14.html
. please help me

phranque

1:57 am on Mar 25, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you're missing the closing quote on the href attribute of an anchor tag.
if it's an internally referred reques you should fix that first.

lucy24

3:01 am on Mar 25, 2012 (gmt 0)

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



... and if it's an external link you don't have to do anything. You're not obliged to fix other people's errors. Unless it's a very very important link from a site you badly need to be connected to. (In which case you should tell them, because they may have other errors of the same kind.)

rajnvr

4:07 am on Mar 25, 2012 (gmt 0)

10+ Year Member



Hi lucy/phranque- Its an internal link only.

however google webmaster notified there are bunch of links are errored out due to the same issue i have fixed the program but url indexed still remain with %20target=

phranque

5:50 am on Mar 25, 2012 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



by the way, welcome to WebmasterWorld, rajnvr!

what have you tried in your .htaccess to redirect that url?

g1smd

8:06 am on Mar 25, 2012 (gmt 0)

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



If you have fixed the linking, you can now return 410 Gone for those requests:

RewriteRule \%20 - [G]