Welcome to WebmasterWorld Guest from 107.20.108.136

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

help with simple htaccess code

getting the correct code...

     
6:06 pm on Nov 9, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 15, 2004
posts:42
votes: 0


Hi,

I want to redirect gone all pages that contain

*whatever*.html?sort=*whatever*

for example

mypage.html?sort=3d&filter=4
anotherpage.html?sort=1a
etc.

It is important that not all pages containing sort= are redirected to gone status, only when they end in .html?sort=

Would this code work:

RewriteRule *.html?sort=* - [G]

i am sure i have an error somewhere, i believe the . wont be interpreted correctly, and not the? because they are special characters. How could i do this?

thanks in advance!

8:39 pm on Nov 9, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


You cannot test a query string with RewriteRule. It has to be tested separately with RewriteCond. See this thread [webmasterworld.com] for an example to use with your (modified) rule.

Jim

8:54 pm on Nov 9, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 15, 2004
posts:42
votes: 0


thanks, so would something like this work?

RewriteCond *.html %{QUERY_STRING} ^sort=*
RewriteRule - [G]

to RedirectGone all pages that contain

(WHATEVER).html?sort=(WHATEVER)

chirp

2:30 pm on Nov 10, 2005 (gmt 0)

Inactive Member
Account Expired

 
 


Closer. Try this one for size:

RewriteCond %{QUERY_STRING} ^sort= 
RewriteRule \.html - [G]

;)

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members