301 a website to mine within a subfolder
-
Hey there Mozzers,
I have purchased a very amazing Social Media Related Plugin. I already have a business website about digital marketing which pretty much falls in the same category.
I am thinking of transferring that plugin into a subfolder of my own website.
Is there anything I should keep in mind when I do that?
-
I am using Wordpress for CMS.
-
Without the CMS I will guess WordPress.
Move to or add subfolder (if needed)
MAKE A BACK UP I like blogvault.com , vaultpress.com & sucuri.net backups
This url shows you it all.
for moving back to root I KNOW IT IS (mostly great tools you will need anyway)
http://askwpgirl.com/move-wordpress-subdirectory-root/
https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
use
https://generatewp.com/wp-config/
/* Custom WordPress URL. */ define('WP_SITEURL','http://example.com/blog'); define('WP_HOME','http://example.com/wordpress'); define('WP_CONTENT_URL','http://example.com/wordpress/wp-content'); define('UPLOADS','http://example.com/wordpress/wp-content/uploads'); define('WP_PLUGIN_URL','http://example.com/wordpress/wp-content/plugins'); define('COOKIE_DOMAIN','cookies.example.com');
just plugins
See: https://yoast.com/smarter-upload-handling-wp-plugins/
add_filter('upload_dir', 'my_upload_dir'); $upload = wp_upload_dir(); remove_filter('upload_dir', 'my_upload_dir'); funcion my_upload_dir($upload) { $upload['subdir'] = '/sub-dir-to-use' . $upload['subdir']; $upload['path'] = $upload['basedir'] . $upload['subdir']; $upload['url'] = $upload['baseurl'] . $upload['subdir']; return $upload; }
rel=canonical and how to 301 to subfolder
In Settings > General, change the address of your site but not the address of WordPress. For example, if you've been working on the site at
example.com/development
, change the settings as follows:- WordPress address (URL):
http://example.com/development
- Site Address (URL):
http://example.com
Click the Save changes button and move on to the next steps before trying to access your site.
Copying the Files
Using FTP or CPanel file manager, copy (don't move) the following files from your WordPress directory to the root directory:
index.php
.htaccess
, if you have one. If there isn't an.htaccess
file (and the fact that you've turned off pretty permalinks means you're less likely to have one), don't worry about creating one—just skip this step.
Editing index.php
Edit the
index.php
file that you've moved. You could do this by:- editing it in situ after the move, using an FTP client or cPanel file manager
- downloading it from the subdirectory, editing it and then uploading it to the root directory—instead of making a copy
The edit you need to make is to one line at the end of the file. Find the line that reads as follows:
| 1 |
require
('./wp-blog-header.php)
|Change it to:
| 1 |
require
('./subdirectoryname/wp-blog-header.php)
|So if you've been developing in
example.com/development
, just change the line to:| 1 |
require
('./development/wp-blog-header.php)
|Save the new
index.php
file.Create Redirects
Use this tool to generate redirects from your old permalink structure to the
/%postname%/
permalink structure.Your Redirects
Add the following redirect to the the top of your
.htaccess
file:RedirectMatch 301 ^/https://www.yoursite.com/subfolder/([^/]+)/$ https://www.yoursite.com/https://www.yoursite.com/subfolder/$1
RedirectMatch 301 ^/https://www.yoursite.com/blog/([^/]+)/$ https://www.yoursite.com/https://www.yoursite.com/blog/$1
See: https://yoast.com/change-wordpress-permalink-structure/
Use: https://yoast.com/research/permalink-helper.php/
&
https://yoast.com/wordpress-seo-url-permalink/
I hope this helps,
Tom
- WordPress address (URL):
-
Out of curiosity, what CMS is your site on?
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
-
Website Not Performing after switch to HTTPS
We recently switched our client's website to HTTPS but after the move, we've experienced a huge decrease in rankings (off the map), and traffic. Our metas for the homepage are not being picked up by Google, although it was appearing correctly before the switch. We've implemented all redirects, resubmitted URL to Google, and updated GSC. GSC is also reporting errors in our XML stating there are no URLs to crawl. Has anyone had any issues similar? What do you all recommend? Help greatly appreciated
Intermediate & Advanced SEO | | SMRTCHInteractive0 -
Website Redesign, 301 Redirects, and Link Juice
I want to change my client’s ecommerce site to Shopify. The only problem is that Shopify doesn’t let you customize domains. I plan to: keep each page’s content exactly the same keep the same domain name 301 redirect all of the pages to their new url The ONLY thing that will change is each page’s url. Again, each page will have the exact same content. The only source of traffic to this site is via Google organic search and sales depend on the traffic. There are about 10 pages that have excellent link juice, 20 pages that have medium link juice, and the rest is small link juice. Many of our links that have significant link juice are on message boards written by people that like our product. I plan to change these urls and 301 redirect them to their new urls. I’ve read tons of pages online about this topic. Some people that say it won’t effect link juice at all, some say it will might effect link juice temporarily, and others are uncertain. Most answers tend to be “You should be good. You might lose some traffic temporarily. You might want to switch some of your urls to the new structure to see how it affects it first.” Here’s my question: 1) Has anyone ever done changed a url structure for an existing website with link juice? What were your results and do you have a definitive answer on the topic? 2) How much link juice (if any) will be lost if I keep all of the exact content the same but only change each page’s url? 3) If link juice is temporarily lost and then regained, how long will it be temporarily lost? 1 week? 1 month? 6 months? Thanks.
Intermediate & Advanced SEO | | kirbyf0 -
Content Of Dead Websites Can be resused?
I have 2 websites. One website links are from spamy techniques (wrong guy hired) which still has massive links so I started a new website with a fresh domain. Now when the new website (only white hate methods used) has started to show positive movements I feel like its the right time to shut the other website down. Since, I have a lot of content on my first site (spamy links) can i reuse the content again on my new site after I shut down my first site?
Intermediate & Advanced SEO | | welcomecure0 -
Interlinking multiple websites
Most websites (for example) Zalando intern link there other CC tld domains to the root. For example: On http://www.zalando.nl/damesschoenen-pumps/ the links in the footer go to the other CC tld's: http://www.zalando.es , zalando.co.uk etc. Does anyone have experience with the fact if you would interlink to the relevant page on the other CC tld;s.
Intermediate & Advanced SEO | | TjeerdvZ
For example: http://www.zalando.nl/damesschoenen-pumps/ links to http://www.zalando.co.uk/womens-shoes-heels/ in stead of linking to the homepage ?
In theory this would give more relevance intern linking. Looking forward to hear if anyone tried or experienced this and what the results where?0 -
301 Redirects?
We have an e-commerce website with about 4500 products for sale. About 1200 of these items were not showing up in the Google PLA ads because they were $0 dollar items, so we made those products invisible. Then Set 301 Redirects for each of the 1200 items. My question is this; we want to turn back on the 1200 items, should we delete the 301 redirects that are in place for them.? Will it hurt SEO performance by having them?
Intermediate & Advanced SEO | | Goriilla0 -
Website layout for a new website [Over 50 Pages & targeting Long Tail Keywords]
Hey everyone, We are designing a new website with over 50 pages and I have a question regarding the layout. Should I target my long tail keywords via blog pages? It will be easier to manage and list and link out to similar articles related to my long tail keywords using a word press blog. For this example - lets suppose the website is www.orange.com and we sells 'Oranges' Am I going about this in the right way? Main Section: Main Section 1 : Home Page - Keyword Targeted - Orange Main Section 2 : Important Conversion page - 'Buy oranges' Long Tail Keyword (LTK) 1: www.orange.com/blog/LTK1 Subsection(SS): www.orange.com/blog/LTK1/SS1 www.orange.com/blog/LTK1/SS1a www.orange.com/blog/LTK1/SS1b Long Tail Keyword (LTK) 2: www.orange.com/blog/LTK2 Long Tail Keyword (LTK) 3: www.orange.com/blog/LTK3 Subsection(SS): www.orange.com/blog/LTK1/SS3 www.orange.com/blog/LTK1/SS3a www.orange.com/blog/LTK1/SS3b All these long tail pages and sub sections under them are built specifically for hosting content that targets these specific long tail keywords. Most of my traffic will come initially via the sub section pages - and it is important for me to rank well for these terms initially. _E.g. if someone searches for the keyword 'SS3b' on Google - my corresponding page www.orange.com/blog/LTK1/SS3b should rank well on the results page. _ For ranking purposes - will using this blog/category structure hurt or benefit me? Instead do you think I should build static pages? Also, we are targeting more than 50 long tail keywords - and building quality content for each of these keywords - and I assume that we will be doing this continuously. So in the long term term which is more beneficial? Do you have any suggestions on if I am going about this the right way? Apologies for using these random terms - oranges, LKT, SS etc in this example. However, I hope that the question is clear. Looking forward to some interesting answers on this! Please feel free to share your thoughts.. Thank you! Natasha
Intermediate & Advanced SEO | | Natashadogres0 -
Someone To Review My Website
I want someone to review My Website as I'm tired of doing everything but its not getting ranked, one day its in top 50 and on the very next day it jut gets disappear, Website URL: http://goo.gl/duJPf I'm trying to get my inner pages rank in google, http://goo.gl/Ha1Vm http://goo.gl/913DR Can someone please review it and tell me if m doing something wrong or if m missing something! Please suggest Thanks
Intermediate & Advanced SEO | | AnkitRawat0 -
Reversing 301 Re-Directs
What's your philosophy on reversing 301 redirects? Does it depend on how long the redirect has been in place? Is it okay to implement a 301 redirect and remove it if the desired results aren't achieved? Also, what about multiple 301 redirects and removing those? I'm working with a site that has several 301 redirects in place and there's no definite knowledge as to when these were placed. I know there's always a danger and the possibility of unintended results when moving these around. I'm just curious as to what others' experience has been with placing and removing these either within a short period of time or over the course of as much as a year. Thanks in advance!
Intermediate & Advanced SEO | | JamieCottle280