Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Rewrite Help Needed

Posted on 2011-02-11
3
Medium Priority
?
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
requeue earned 500 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

618 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