Can anyone help with my htaccess 301 redirects please? :)

Started by Jade Elizabeth, November 23, 2015, 07:44:30 PM

Previous topic - Next topic

Jade Elizabeth

I'm having a bit of issues with my htaccess and I am sure it's simple but I am not sure what to do....

I moved wordpress up to root from /news and my redirect works at redirecting blog posts but redirects /news to /news which isn't what I want. I need to redirect all /news to / BUT if it's asking for a blog (/news/cat/post-title) then it needs to redirect to the blog on the root (/cat/post-title).

RewriteEngine on

RewriteCond %{HTTP_HOST}  ^www\.example\.com$ [NC]
RewriteRule ^news/$ http://www.example.com/%{REQUEST_URI} [R=301,NE,NC,L]

# 301 Redirect URLs.
Redirect 301 http://www.example.com/news http://www.example.com


I thought I had it but I am sure I am missing something. It's very confusing trying to follow guides online, a lot of them conflict and a lot of the generators come out with some bizarre stuff.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: