Hi everyone,

I am doing on page optimization for one my client but I want to change the URL of my website without effecting the other navigations in the webpage.

Here is the webpage that I need to be optimized

www.xxxxxxxxxx.com/what-we-do/managed-services/data-centre-services.php

I need to change the above URL into

www.xxxxxxxxxx.com/data-centre-services.php

I mean there are many other pages of which I want to remove these extra words "/what-we-do/managed-services/" from the URL's.

Kindly help me by replying to my question with the required code to be used to resolve this issue.

Regards
Jaspal

Dani AI

Generated

Changing a site’s public URLs without breaking navigation or harming SEO takes planning. The thread’s advice is sensible: correctly cautions about changing pages that already rank well, ’s idea of staging and promoting new pages first reduces risk, and ’s point about preserving link signals is important. Two practical ways to get shorter addresses like /data-centre-services.php from /what-we-do/managed-services/data-centre-services.php are (A) expose the short URL while serving the file from the existing folder via an internal rewrite, or (B) move the file to the root and implement permanent redirects from the old nested URL to the new root URL.

A safe rollout checklist: (1) crawl the site and build a full old→new URL map; (2) test everything on a staging server; (3) choose rewrite (transparent) or 301 redirect (permanent move) and implement on the server; (4) update internal navigation and canonical tags so the short URL is the site’s canonical address; (5) update the XML sitemap and resubmit to Google Search Console; (6) monitor 404s, redirect chains and traffic; keep redirects in place for at least 6–12 months (longer if many external links exist). If high-value pages already rank well, prefer staged promotion or consult an SEO before changing live URLs.

Example server rules (adjust and test first):

Apache (.htaccess) — permanent redirect from nested folder to root:

RewriteEngine On
RewriteRule ^what-we-do/managed-services/(.+)$ /$1 [R=301,L]

Apache — internal rewrite (show short URL but serve file from nested folder):

RewriteEngine On
RewriteRule ^([^/]+\.php)$ /what-we-do/managed-services/$1 [L]

Nginx — permanent redirect:

rewrite ^/what-we-do/managed-services/(.*)$ /$1 permanent;

Common pitfalls: redirect loops or chains, CDN caching, forgotten internal links, and removing redirects too soon. Test with an HTTP tool and a site crawler, watch Search Console and analytics for drops, and keep a rollback plan.

There are ideal situations in SEO where everything is perfectly optimized, but if you already rank well, you could be better off leaving things alone. This is where consulting with a qualified SEO can be extremely valuable since it is a very case-by-case thing.

If you are getting very good ranking and traffic on the old pages then don't remove them, first create new pages and promote the new pages for the targeted keywords and when you will get the ranking on new pages then replace the old URL's to New

Use 301 redirection for replacing new URLs over the old ones. 301 redirection helps to maintain your backlinks pointed to your domain also...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.