Solved

Rewrite Help Needed

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

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

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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 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

6 Experts available now in Live!

Get 1:1 Help Now