?
Solved

htaccess 301 for entire folder and contents

Posted on 2013-10-22
5
Medium Priority
?
307 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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

765 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