Moving Folder to Folder

Joined
Aug 20, 2022
Messages
47
Likes
4
Degree
0
Hi BuSo,

So, i have an issue for structuring website.

I have an old website, that had structure like this:

https://domain.com/blog/into/articles-ulr

What i want is removing /blog/ and keep the /into/

So the url after removing should be:

https://domain.com/into/articles-url

How can i do that, what should i do first and more, to keep my rank (if any) in search engine.

Thank you
 
Last edited by a moderator:
What CMS are you using?

If this is WordPress then you simply update the permalink (Settings >> Permalink) from /blog/into/ to /into/ and the redirects will happen automatically and eventually the search engines will show the new pages.

You have to make sure the .htaccess is at the root domain correctly OR if you are on NGINX you have the proper redirects in place within your site-available/(domain).conf file.

If it's not WordPress then whatever CMS you use normally handles redirects.

If there is no CMS and these are static pages than you have to do the old-school way of redirecting with an .htaccess file like so (assuming Apache 2 server):

Code:
RewriteEngine On
RewriteRule ^blog/(.*)$ /$1 [R=301,L]

Nginx version:

Code:
server {
    listen 80;
    server_name domain.com;

    location /blog/ {
        rewrite ^/blog/(.*)$ /$1 permanent;
    }

    # Other configurations for the server...
}
 
@CCarter , thank you for responses, This is custom cms.

So it just simply remove the folder /blog/, and setup redirect to /into/?

How about submitting to search console, xml or etc? What should i do?
 
@CCarter , thank you for responses, This is custom cms.

So it just simply remove the folder /blog/, and setup redirect to /into/?

How about submitting to search console, xml or etc? What should i do?
I think the 2nd line on the .htaccess needs to say ^icode/(.*)$ instead of "blog", as well as the rewrite line on the nginx version.

If your CMS was installed at /blog/ you shouldn't have to do anything other than change the "site address URL" to reflect the change, so that the sitemaps all make the change for you.

If this is an old HTML/PHP site then you'll have to change your sitemaps on your own, in which case Google will pick that up.

If you choose not to correct the sitemap, it'll always be wrong and any time Google crawls from it they'll see the redirect and successfully crawl, but it's a waste of their "crawl budget" so I wouldn't do that. It might matter at a very, very, very small amount with ranking.

It would be helpful if you tell us if this is flat file, HTML/PHP, Javascript, Wordpress, Drupal, etc.
 
@Ryuzaki, the site is built with Custom Php and some javascript. The site was one of my friend that can code, created the site.

Talk about it
If your CMS was installed at /blog/ you shouldn't have to do anything other than change the "site address URL" to reflect the change, so that the sitemaps all make the change for you

There's a folder under domain.com, not wordpress or other cms. So, i just redirect /into/ to /blog? The /into is just like static pages.

And, what if i am also want to change the /into tobe /author, /category, etc. so it should be domain.com/blog/category, /blog/author, /blog/etc.
 
Last edited:
Back