Redirect wordpress from /%post_id%/%postname%/ to /blog/%postname%/
-
Hi what is the code to redirect wordpress blog from site.com/%post_id%/%postname%/ to site.com/blog/%postname%/ We are moving the site to a new server and new url structure.
Thanks in advance
-
Hi Tim, thanks for your help.
Yes wordpress will be installed in a folder /blog/
So it should be quite simple to do this redirect!
Regards Tai
-
First off, I would imagine you need your wordpress installation to be inside a /blog/ directory on your server, unless you can do some fancy redirect.
Secondly, in order to change the URL structure from post id / post name. You can do this in your wordpress settings.
Go to -> Settings -> Permalinks.
You will need to select a custom structure, something like
/%postname%/or if you wish to keep hold of the ID
/%postname%-%post_id%/Then save your settings.
Hopefully that does the trick.
Cheers
Tim
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
-
Redirection Problem
I have a site that has 2,50,000 pages and I want to redirect to another domain. Is it good practice for SEO and google?
Intermediate & Advanced SEO | | MuhammadQasimAttari0 -
SEO Strategy - Content/Outreach/Links
Hi everyone I'm trying to prioritise my tasks for 2018 & wondered if anyone had any useful templates they use? In terms of SEO tasks, my priority was going to be content/outreach/links - Focusing on user guides/blogs onsite Then outreach articles/some PR that doesn't go against Google guidelines offsite. My struggle with the onsite content/blogs we produce is we have no real social media plan/manager so my content outreach always seems hampered by this. I've tried taking on some of the social stuff, but this ends up being too much for just me to do. I wondered if there were any other SEOs who face this issue and who have found some good solutions? I'm stuck in a bit of a rut and can't seem to effectively push forward with outreach/content writing. Thank you Becky
Intermediate & Advanced SEO | | BeckyKey1 -
Two blogs on a single domain?
Hi guys, Does anyone have any experience of having (trying to rank) two separate blogs existing on one domain, for instance: www.companysite.com/service1/blogwww.companysite.com/service2/blogThese 2 pages (service 1 and service 2) offer completely different services (rank for different keywords).(for example, a company that provides 2 separate services: SEO service and IT service)Do you think it is a good/bad/confusing search engine practice trying to have separate blogs for each service or do you think there should be only one blog that contains content for both services?Bearing in mind that there is an already existing subdomain for a non-profit part of business that ranks for different keywords: non-profit.companysite.comand it will potentially have another blog so the URL would look like: non-profit.companysite.com/blogAny ideas would be appreciated!Thanks
Intermediate & Advanced SEO | | kellys.marketing0 -
How to implement three languages with a subfolder /blog on a .com domain?
Hi, I'm setting up a blog for a client that has a .com domain. The client is targeting three languages with the subfolder /de, /nl and /en. We've also established that a blog rather be used in a subfolder than subdomain. My question: How should we implement the three languages? Is this gonna be a domain.com/blog/en or domain.com/en/blog or would you maybe don't use subfolders for language at all but let a hreflang do the job?
Intermediate & Advanced SEO | | dexport0 -
Geoip redirection, 301 or 302?
Hello all Let me first try to explain what our company does and what it is trying to achieve. Our company has an online store, sells products for 3 different countries, and two languages for each country. Currently we have one site, which is open to all countries, what we are trying to achieve is make 3 different stores for these 3 different countries, so we can have a better control over the prices in each country. We are going to use Geoip to redirect the user to the local store in his country. The suggested new structure is to add sub-folders as following: www.example.com/ca-en
Intermediate & Advanced SEO | | ajarad
www.example.com/ca-fr
www.example.com/us-en
... If a visitor is located outside these 3 countries, then she'll be redirected to the root directory www.example.com/en We can't offer to expand our SEO team to optimize new pages for the local market, it's not the priority for now, the main objective now is to be able to control the prices for different market. so to eliminate the duplicate issue, we'll use canonical tags. Now knowing our objective from the new URL structure, I have two questions: 1- which redirect should we use? 301, 302?
If we choose 301, then which version of the site will get the link juice? (i.e, /ca-en or /us-en?)
if we choose 302, then will the link juice remain in the original links? is it healthy to use 302 for long term redirections? 2- Knowing that Google bots comes from US-IP, does that mean that the other versions of the site won't be crawled (i.e, www.example.com/ca-fr), this is especially important for us as we are using AdWords, and unindexed pages will effect our quality score badly. I'd like to know if you have other account structure in your mind that would be better than this proposed structure. Your help is highly highly appreciated.
Thanks in advance.0 -
Redirects in .htaccess file
I am using yoast seo plugin for wordpress. I have done several link changes and placed approximately 80-100 301 redirect into .htaccsses file. Is this good practice? Do they have to be there forever? Is it not slowing down site? Or should this be done in different way? Thank you very much Iris
Intermediate & Advanced SEO | | Rebeca10 -
Subdomain blog vs. subfolder blog in 2013
So I've read the posts here: http://moz.com/community/q/subdomain-blog-vs-subfolder-blog-in-2013 and many others, Matt Cutts video, etc. Does anyone have direct experience that its still best practice to use the sub folder? (hopefully a moz employee can chime in?) I have a client looking to use hubspot. They are preaching with the Matt Cutts video. I'm in charge of SEO / marketing and am at odds with them now. I'd like to present the client with more info than "in my experience in the past I've seen subdirectories work." Any help? Articles? etc?
Intermediate & Advanced SEO | | no6thgear0 -
Blog content - what to do, and what to avoid in terms of links, when you're paying for blog content
Hi, I've just been looking at a restaurant site which is paying food writers to put food news and blogs on their website. I checked the backlink profile of the site and the various bloggers in question usually link from their blogs / company websites to the said restaurant to help promote any new blogs that appear on the restaurant site. That got me wondering about whether this might cause problems with Google. I guess they've been putting about one blog live per month for 2 years, from 12/13 bloggers who have been linking to their website. What would you advise?
Intermediate & Advanced SEO | | McTaggart0