Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Rewrite Help Needed

Posted on 2011-02-11
3
Medium Priority
?
241 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 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
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
Course of the Month20 days, 18 hours left to enroll

810 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