LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache Rewrite Command (https://www.linuxquestions.org/questions/linux-newbie-8/apache-rewrite-command-4175439498/)

wilkos73 11-30-2012 03:14 PM

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!!!

bathory 12-01-2012 02:06 AM

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

Habitual 12-01-2012 09:06 AM

  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!


All times are GMT -5. The time now is 06:25 PM.