A friendly URL is one a person can read and understand before even clicking it, like mysite.co.ke/services/web-hosting instead of mysite.co.ke/index.php?id=42&cat=3. Clean URLs are easier for visitors to trust and share, and search engines use the words in a URL as one of many signals when ranking a page.
Guidelines for Writing Good URLs
- Use words, not IDs: Describe the page's content, e.g. /blog/how-to-renew-a-domain rather than /blog/post?id=17.
- Use hyphens between words, not underscores or spaces. Search engines treat hyphens as word separators.
- Keep it lowercase. Mixed-case URLs can create duplicate-content confusion since some servers treat them as different addresses.
- Keep it short and specific. Include the key term for the page without stuffing in every possible keyword.
- Avoid unnecessary parameters like session IDs or tracking codes in the visible URL where possible.
How to Set This Up
Most content management systems, including WordPress, generate friendly URLs automatically based on a page or post's title, with an option to edit the URL slug directly before publishing. For custom-built sites, friendly URLs are typically implemented with URL rewriting rules in your .htaccess file (Apache) that map a clean address to the actual script handling it behind the scenes.
Redirects: When and Why
If a page's URL changes, whether from a redesign, a WordPress permalink structure change, or simply renaming a page, any existing links, bookmarks, or search engine listings pointing to the old address will break unless you add a redirect from the old URL to the new one.
Setting Up a Redirect
- In cPanel, open Redirects under the Domains section.
- In DirectAdmin, open Domain Setup and look for the redirect or URL forwarding option for the relevant domain.
- Choose the type: a 301 (permanent) redirect for a URL that has moved for good, or a 302 (temporary) redirect if the move is short-term.
- Enter the old URL path and the new destination, then save.
For redirects on a WordPress site, many SEO plugins include a redirect manager that avoids editing .htaccess directly.
Use a 301 redirect for anything permanent. Search engines pass the old page's ranking signals to the new address with a 301, but generally don't with a 302, since a 302 tells them the old URL might come back.
Common Mistake: Redirect Chains
Avoid redirecting a URL to another URL that itself redirects elsewhere. Each extra hop slows down the page load and can confuse both visitors and search engines. Point every redirect straight to the final destination.