[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

htaccess 301 for entire folder and contents

Posted on 2013-10-22
5
Medium Priority
?
310 Views
Last Modified: 2013-10-29
Hello,

Should be simple, but I can't find with google searches.

I want to redirect all the content (pages, images) from my wordpress blog that used to be in the "Blog" folder into the main directory

Redirect 301 /blog/*wild card of any content and folders* http://www.darkstarmedia.net/*wild card of any content and folders*

I am building a new site and eliminating the blog folder, the whole site will be wordpress now
0
Comment
Question by:jblayney
[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
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:Murfur
ID: 39591532
RewriteEngine On
RewriteRule ^blog/?(.*) /$1 [R=301, L]

Open in new window

0
 
LVL 1

Author Comment

by:jblayney
ID: 39591635
Will this conflict with the existing Wordpress rewrite?
0
 
LVL 11

Accepted Solution

by:
Murfur earned 2000 total points
ID: 39591717
Put it as the first rule so that it processes before any other wordpress specific rewrite
Should look something like this:

RewriteEngine On
RewriteBase /
RewriteRule ^blog/?(.*) /$1 [R=301]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Open in new window


Also remember to update your 'WordPress Address' in General Settings
0
 
LVL 1

Author Comment

by:jblayney
ID: 39608999
Hello,

On further testing, this is not working, I am starting to get google webmaster tools errors for URLs starting with /blog/

When i test "/blog/category/graphic-design-2/" for exmaple it gives me  a 404 instead or redirecting me
0
 
LVL 1

Author Comment

by:jblayney
ID: 39609010
actually, 301 redirects do not work at all
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

656 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