Wordpress, Redirects and HTacess file
-
Converted site to wordpress and having a bit of trouble with re-directs not redirecting.
Could somebody tell me whether redirects go before the
`# BEGIN WordPress` or after the # END wordpress or immediately after this bit -
<code># BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On RewriteBase /</ifmodule></code>
section of the code within my htacess file? Just wondered if this is the cause of my problems! Cheers Ted
-
Hi Takeshi,
I only need to get 2 redirects working, so I thought a plug in was a bit overkill.
They are already present in the htaccess file from the previous site (I'm running wordpress from a sub-folder but switched everything over as per the wordpress instructions.
Got the following which doesn't seem to work (any ideas what is wrong?)
RewriteCond %{HTTP_HOST} ^example.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.example.co.uk$
RewriteRule ^/?$ "http://www.newsite.co.uk" [R=301,L]The above should redirect from example.co.uk OR www.example.co.uk
and the is that is giving me a few problems is
RewriteCond %{HTTP_HOST} ^newsite.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.newsite.co.uk$
RewriteRule ^oldpage.htm$ "http://www.newsite.co.uk/new-page.htm" [R=301,L]That should redirect from newsite.co.uk/oldpage.htm
All these are already existing redirects done previously through my htaccess file but not too sure if the coding is correct for a wordpress based site but the last one above does not seem to be working at all!
Any ideas would be great and a big help!
Cheers
Ted -
They would go after the #END wordpress line. You can also install the plugin called "Redirection" which will allow you to put in 301 redirects without mucking about with your .htaccess file.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Google.com country redirection
As we all know, Google redirected the user based on location automatically.
Image & Video Optimization | | Moojin
e.g., connect to www.google.com from Korea, google automatically redirected to www.google.co.kr
However, for sometimes I noticed that if I connect to www.google.com, it doesn't redirect to local google anymore. I tested by using VPN, and seems like Google no longer do location redirection. Does anyone have any idea about this?0 -
Redirecting photos during site redesign?
Hello, We are doing a website redesign for a long-standing client. Their new website is completely different and includes mostly new elements, My question is do we need to redirect photo URLs if they are no longer on the site, and if so where do we redirect them, the homepage? Thank you! Tyler
Image & Video Optimization | | BeyondIndigo0 -
Image Gallery - Name of the image files
I would like to know If I have a image gallery in my website, what name must I put in the image files? Can I associate with the my key-word? Ex: Post about pizza buffet, and than... the images can have the name "pizza-buffet-01, pizza-buffet-02"? Is it wrong? Thank you
Image & Video Optimization | | otimizador20130 -
Images in Wordpress
Wondering how best to utilize the tags for images in Wordpress. I have these fields: Title Alternate Text Caption Description Is it important that I fill all of these fields in? And for these fields - is it best to use hyphens or underscores for SEO? Thanks.
Image & Video Optimization | | bigeyecreative0 -
URL redirect to a YouTube Channel?
Hey all, We recently ran a video content contest on a micro site and we generated some links for the URL. In December we are planning on doing a redirect of the domain to our YouTube channel where all of the videos hosted. My question is how much SEO benefit will there be by redirecting to our YouTube channel vs redirecting to a single video from the contest. Does the strength of the channel as whole affect the videos in that channels ability to rank on YouTube and in SERPs? The other option is to just redirect the URL to our product page on our main website, but to me that doesn't seem like it would provide the best user experience 🙂 If anyone has experience with this kind of an issue I'd appreciate your feedback. Thanks!
Image & Video Optimization | | Tektronix0 -
301 Redirect affects Google Places Listing?
Hi, A client of ours has a Google Places Listing but over the last few days we noticed that two duplicate listings have appeared with exactly the same information as the original listing. Only difference is the domain names. I did some investigation and my client says that a company cold called them recently and sold them two domain names www.bandbinbanbury.co.uk andwww.accommodationinbanbury.co.uk and it seems these two are redirecting to the main site which sits on www.hanwellhouse.com My question is can this cause that the redirected listing now appear instead of the original google places listing? Any help will be appreciated
Image & Video Optimization | | InTouchMarketing560 -
Self Hosting Videos in Wordpress
Hi, I'm trying to figure out the best way to host my own videos on my website in addition to uploading them to YouTube. My site is Wordpress-based, and I use Pages for the main landing pages, Posts to create the different products I offer. Is there a good way to upload my videos of each product into those Posts for SEO purposes? Maybe there's a specific plugin that I should be using? Thanks in advance, Shawn
Image & Video Optimization | | darkgreenguy0 -
Google’s algorithm on file size. Use IFrame or not?
With page size being a big factor in Google’s algorithm what’s the best way to implement a flash file without jeopardizing rankings? What’s your thoughts on embedding the video in an IFrame?
Image & Video Optimization | | SEO-Team0