SEO-friendly URLs (also called "clean URLs" or "pretty permalinks") replace query-string URLs like page.php?id=42 with readable paths like /products/blue-widget. They are better for search engines and for users. Here is how to enable them on your hosting account.
Change your permalink structure in Settings
Go to WordPress Admin > Settings > Permalinks and select "Post name" (the /%postname%/ option). Click Save. WordPress automatically creates the necessary .htaccess rules. This is the recommended permalink structure for SEO.
01. WordPress Permalinks
- Log into WordPress Admin
- Go to Settings > Permalinks
- Select "Post name"
- Click "Save Changes"
WordPress writes the required rewrite rules to your .htaccess file automatically. If it cannot write to .htaccess (permission issue), it will show you the rules to paste in manually.
If pretty permalinks result in 404 errors for all pages except the homepage, mod_rewrite may not be processing your .htaccess. This can happen with nginx reverse proxy configurations. See Nginx and .htaccess Redirect Issues for the fix.
02. Custom URL Rewriting With .htaccess
For non-WordPress sites, you can create clean URLs using Apache's mod_rewrite module. Add rules to your .htaccess file:
RewriteEngine On
# Rewrite /products/blue-widget to product.php?slug=blue-widget
RewriteRule ^products/([a-z0-9-]+)$ product.php?slug=$1 [L,QSA]
# Rewrite /blog/123/my-post-title to blog.php?id=123
RewriteRule ^blog/([0-9]+)/([a-z0-9-]+)$ blog.php?id=$1 [L,QSA]
The visitor sees the clean URL in their browser, but your PHP script receives the original query parameters. For a complete guide on rewrite rules, see Complete Guide to .htaccess.
03. Other Applications
Most modern CMS platforms and frameworks have built-in SEO URL support:
- Joomla - System > Global Configuration > SEO Settings > enable "Search Engine Friendly URLs" and "Use URL Rewriting." Rename
htaccess.txtto.htaccessin your Joomla root. - Drupal - Clean URLs are enabled by default in Drupal 8+. For Drupal 7, go to Configuration > Clean URLs.
- Laravel / Symfony / CodeIgniter - These PHP frameworks handle URL routing internally. Make sure the
.htaccessfile in thepublicdirectory is intact. - Custom PHP - Use the
mod_rewriteapproach from section 02.
04. SEO URL Best Practices
- Use hyphens between words -
/blue-widgetnot/blue_widgetor/bluewidget. Google treats hyphens as word separators. - Keep URLs short and descriptive -
/hosting/shared-plansis better than/our-company/services/web-hosting/shared-hosting-plans-overview - Use lowercase - URLs are case-sensitive on Linux. Stick to lowercase to avoid duplicate content issues.
- Include relevant keywords - But do not stuff them. The URL should read naturally.
- Avoid changing URLs after publishing - If you must change a URL, set up a 301 redirect from the old URL to the new one.
For more SEO guidance, see How to Submit Your Site to Search Engines.
Need Help With URL Configuration?
If your clean URLs are not working or you need help writing .htaccess rewrite rules, our team can assist.
Open a Support TicketQuick Recap
- WordPress - Settings > Permalinks > Post name
- Custom PHP - Use mod_rewrite rules in .htaccess
- Use hyphens between words and keep URLs short
- All lowercase to avoid case-sensitivity issues
- 301 redirect old URLs if you change them after publishing
Improving your site's URL structure · Last updated March 2026 · Browse all Website Tools articles
