Solved

Rewrite Help Needed

Posted on 2011-02-11
3
233 Views
Last Modified: 2012-05-11
I need to redirect a url

http://www.abc.com/12all/lt.phpc=1590&

to a discontinued page.  Here is what I have tried that isn't working.

RewriteCond %{REQUEST_URI} ^12all/lt\.phpc=([0-9]+)$ [NC]
RewriteCond %{QUERY_STRING} ^&amp$ [NC]
RewriteRule ^.+$ /discontinued.html? [NC,R=301,L]

I have other rewrites working but I can't seem to get this to pattern match so I need help.

Thanks,

Randal
0
Comment
Question by:sharingsunshine
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
requeue earned 125 total points
ID: 34876255
Is your url correct ?

I think you have php script lt.php and query is ?c=1590&amp.
If that is the case url will like this:
http://www.abc.com/12all/lt.php?c=1590&amp

Otherwise, you don't have query string.

0
 
LVL 2

Expert Comment

by:requeue
ID: 34876293
If my guess is correct htaccess is like this:

RewriteCond %{REQUEST_URI} ^/12all/lt\.php$ [NC]
RewriteCond %{QUERY_STRING} ^c=([0-9]+)&amp$ [NC]
RewriteRule ^(.+)$ /discontinued.html? [NC,R=301,L]

You need "/" before 12all.
0
 

Author Comment

by:sharingsunshine
ID: 34876737
You gave me the answer when you said it's not a query without a ?.  I removed the query string and it worked.

Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now