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.
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 -
Would you recommend changing image file names retroactively?
We'll be optimizing file names moving forward, but it hasn't been done in the past. I have probably 1,500 that would need to be changed, so want to make sure it's a valuable use of time/worth the effort. 🙂 Also, has anyone used Media File Renamer for wordpress? Seems this would be a good way to rename files without needing to reupload everything. Thanks!
Image & Video Optimization | | jennafrye0 -
What's better for SEO an Optimized Image URL vs Optimized Image File Name?
I would like to know what is best practice for optimizing images for our website. Is it better to give an Image an optimized filename Or an optimized URL for SEO? Or is it better to do both? Would there be any harm in doing both if they are identical in their format? Any help would be greatly appreciated. With thanks, Kate
Image & Video Optimization | | K_borg0 -
Best Video Sitemap plugin for wordpress? And do I need both a video sitemap and a normal one?
Hi all, I currently use the Google XML Sitemaps plugin on my wordpress site. But we've recently began adding (self-hosted) videos that we've been careful to markup with the relevant schema. However, there's a couple of things I don't understand and am hoping someone could help: Do we need a separate video sitemap that either works alongside Google XML Sitemaps or replaces it? If we do need a video sitemap, what's the best video site map to get? (we are using the Thesis theme so can't use the Yoast one unfortunately as they don't play nice together...) Thanks for your help! Andrew
Image & Video Optimization | | seowhiskey0 -
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 -
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