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?
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
-
Sale Pages On An eCommerce Website
I have a client who sells 50 brands of shoes. At the moment the developer has a noindex/nofollow tag on all sale pages which is wrong as around 10% of site activity revolves around those pages. The structure looks like this: 1. For Cats/Sub Cats site/sale
Intermediate & Advanced SEO | | Nigel_Carr
site/womens/sale
site/womens/shoe/sale
site/womens/shoes/ballerinas/sale For every cat/subcat - there are 10 cats and average 5 subcats per cat so 50 pages of sale. 2. For Brands site/brand
site/brand/womens
site/sale/brand
site/sale/womens/brand
site/sale/womens/cat/brand
site/sale/womens/cat/subcat/brand So each brand can have four sale pages on top of its own brand page. 50 brands x 54 = around 2700. Now no one is going to start writing 2700 pieces of additional on page content (although Meta is OK! ) and we risk further diluting the brand pages we need to show highly for, so we need to do something. Should we Category Pages: 1. Allow all sale cat and subcat pages to proliferate through Google? or
2. Canonicalise all sale sub category pages back to category
3. Caonicalise all category and Subcategory pages back to sale/womens Brand Pages: 1. Allow all sale brand pages to proliferate through Google ?
2. Canonicalise Sub Cat brand pages back to sale/category/brand
3. Canonicalise Sub Cat and Cat back to sale/brand Note the lower pages never do well in search. If you search a brand + Sale in Google it is always the site/brand page that comes up, never the sale version (This is from research on other similar sites and my own analysis) Same with Sub Cats - eg, Brand + Subcat - it's always site/brand that comes up first wand has the highest PA. Also we can't analyse any of these sale pages in MOZ or anywhere else as they are not in search at all having been no indexed. That's my conundrum for today, Any thoughts would be appreciated!0 -
301 redirect impact on ranking
If Website A is ranking 19th position in Google for a specific keyword, and Website B is ranking 30th position for the same keyword, What would be impact after 301 redirect? Will Website A drop to 30th position because of 301 or existing position would improve because of link juice?
Intermediate & Advanced SEO | | riyaaaz0 -
301 redirects
Hello, I want to ditch about 1000 pages of a 2000+ page site. I believe the 301 redirect thing is the way to go but my expertise is limited. Is there a way to do a blanket redirect ie if a user or search engine looks for a page thats not there it all gets redirected to the index page or do I have to do each one manually? Thanks Ian
Intermediate & Advanced SEO | | jwdl0 -
Hosting two websites
Hi guys, I work with a company that has a business to consumer (B2C) website and a business to business (B2B) website selling the same product. The content will differ but the structure / templates will be similar across both sites. Any recommendations or suggested reading to ensure both sites appear in Search? Many thanks in advance! Richard
Intermediate & Advanced SEO | | Richard5550 -
Can anyone tell me if this website was built with Frontpage or another cookie cutter drag and drop website creator by looking at the source code?
Can anyone tell me if this website was built with Frontpage or another cookie cutter drag and drop website creator by looking at the source code? http://naturespremiumpestdefense.com/ Thanks, Russell
Intermediate & Advanced SEO | | ULTRASEM0 -
Should you replace the url on a damaged page and 301 to it ?
Hi, We have a couple of pages which have been damaged due to an SEO person we hired creating a stupid amount of bookmarks and generally poor links. I've tried to get the links removed where I can but on most of these blogging sites there is no contact webmaster etc so I am struggling. Panda update as also affected traffic by about 35%. My question is , should I consider creating new urls for the "damaged " pages and then doing 301 redirects to them from the damaged page to the new page. Then start to build up good links to the new page whilst google should de-index the old pages over a couple of months ?. Just at my witts end how to get rid of these blogging rubbish etc etc. Thanks Sarah.
Intermediate & Advanced SEO | | SarahCollins0 -
Local + National seo for a new website
Hi, Look for idea for a website owner selling training courses on painting , he wants to be ranked locally first but also national on google Serp (only one physical address available). His domain name is rather a branded one (no kw in it), and the website is recent (1 year) . An audit will be focused on competitor rankings to find niche KW. I 'd advise : - For local : optimized Google address listing + local business directories + optumized page with local emphasis (shema.org ..) For national : to make unique relevant content pages with keywords geographically targeted (according audit), for instance for a specific town, to include terms related to this particular local market etc.. 1/ What 's else could i suggest to start a national ranking ? 2/ Have you heard of a tool to make distant queries on Google ? I mean , i leave in Madrid (spain) and want to see google serp as if i was in Barcelona ? (seems difficult as google uses Ip). Tks in advance for your advices...
Intermediate & Advanced SEO | | mlc0 -
301 vs. 404
If a listing on a website is no longer available to display is it better to resolve to a 301 redirect or use a 404? I know from an SEO point of view a 301 will pass on the link value, but is that as valuable as saying tto the user hey that page is no lonoger available try something else?
Intermediate & Advanced SEO | | AU-SEO0