Redirect URL for invalid pages

Using mod_rewrite to handle various content issues

Redirect URL for invalid pages

Postby Vegabond » Tue Dec 12, 2006 10:38 am

Hello Richard,

Google still not removing these type URL for my site. I want to redirect this type URL to my main domain for Search engine crawling. Want to remove them from SE.
www.allthelink.com/review.php?sid=195
www.allthelink.com/index.php?cat=42

They are not a valid page in Allthelink.com but header status is not 404

Let me know if you need any others information.

Thanks
Shabu Anower
Vegabond
 
Posts: 8
Joined: Tue Sep 26, 2006 12:22 pm
Location: Bangladesh

Postby richardk » Tue Dec 12, 2006 11:29 am

Mod_rewrite can't send a 404 header. You need to edit index.php and review.php to send a 404 header when it's not found. Look at header().
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Vegabond » Tue Dec 12, 2006 11:36 am

But mod_rewrite can redirect invalid query to main domain. I am looking for that :)
Vegabond
 
Posts: 8
Joined: Tue Sep 26, 2006 12:22 pm
Location: Bangladesh

Postby richardk » Tue Dec 12, 2006 11:42 am

You should still do it in the script. Mod_rewrite can't tell if it exists in the database or not, you'd have to hard code it. what happens when someone (or some bot) uses an ID that doesn't exist and you haven't added it to the mod_rewrite?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby Vegabond » Tue Dec 12, 2006 11:48 am

okay Richard, I will try it.

Thanks :)
Vegabond
 
Posts: 8
Joined: Tue Sep 26, 2006 12:22 pm
Location: Bangladesh


Return to Content

Who is online

Users browsing this forum: No registered users and 0 guests

cron