LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2012, 04:14 PM   #1
wilkos73
LQ Newbie
 
Registered: Nov 2012
Posts: 10

Rep: Reputation: Disabled
Apache Rewrite Command


I have a website that I am working on that 301 redirects were not installed the first time. The site has the following format:

http://www.OURSITE.com/current_categ...gion=aroostook

Since 99% of the old URLs contain "current_category" is there a way to write a rule to capture any url containing this and redirect it?

( This would save a lot of time if possible. If not I assume eache individual URL or the 650 of them needs to be redirected individually)

Thanks for your Help!!!
 
Old 12-01-2012, 03:06 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,516

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
Hi,

You don't give much details about the final URL, but you can use either RedirectMatch for simple redirections, or mod_rewrite for complex ones. In this case you need to use something like
Code:
RewriteCond %{REQUEST_URI} ^/current_category
Regards
 
1 members found this post helpful.
Old 12-01-2012, 10:06 AM   #3
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,158
Blog Entries: 10

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
  1. .htaccess tricks and tips - Part I
  2. .htaccess tricks and tips - Part II
  3. Forcing or eliminating the WWW
  4. Rewrites and https
  5. Anti-leech
  6. .htaccess files useful tips and tricks
  7. Comprehensive guide to .htaccess - Blocking bad bots
  8. Ten awesome .htaccess hacks for WordPress
  9. The A-Z of WordPress .htaccess hacks
  10. Htaccess tricks
corz.org is an awesome htaccess resource.


Have a Great Day!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache rewrite help vockleya Linux - Server 1 06-18-2011 12:36 AM
Apache Rewrite mahmoud Linux - Software 2 11-11-2008 08:52 AM
Apache Rewrite mahmoud Linux - Newbie 2 10-08-2008 09:11 AM
apache rewrite help deesto Linux - Server 3 11-03-2006 03:07 PM
Need help with Apache rewrite kinetik Linux - General 6 05-19-2006 07:02 AM


All times are GMT -5. The time now is 06:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration