
# Pretty URL: /booking/my-bookings/{employee_id}
RewriteRule ^booking/my-bookings/([0-9]+)/?$ book/my_bookings.php?employee_id=$1 [L,QSA]
In the world of modern web development and digital marketing, Pretty URLs (also known as clean URLs or SEO-friendly URLs) play a vital role in improving both user experience and search engine rankings.
What Is a Pretty URL?
A Pretty URL is a user- and search-engine-friendly format of a URL that removes unnecessary parameters or script names. Instead of using:
https://example.com/book/my_bookings.php?employee_id=123
You present it as:
https://example.com/booking/my-bookings/123
This is not only more readable for users, but it also provides clear keyword context for search engines.
Why Pretty URLs Are Good for SEO
- Improved Readability Clean URLs are easier for humans to read and remember. A URL like /booking/my-bookings/123 instantly tells users what the page is about.
- Better Click-Through Rates (CTR) On search engine result pages (SERPs), a clean URL increases trust and can lead to higher CTR compared to messy URLs with query parameters.
- Keyword Inclusion URLs with meaningful keywords (like booking, my-bookings) help search engines understand page relevance — boosting SEO rankings.
- Social Media Sharing Clean URLs look better when shared across platforms like Facebook, Twitter, or LINE. Users are more likely to click on them.
How to Implement Pretty URLs in Apache (with
.htaccess
)
If you’re using Apache, you can use mod_rewrite to transform URLs using RewriteRule. For example, to convert:
/booking/my-bookings/123
into:
/book/my_bookings.php?employee_id=123
Add the following to your .htaccess file:
RewriteEngine On
RewriteRule ^booking/my-bookings/([0-9]+)/?$ book/my_bookings.php?employee_id=$1 [L,QSA]
✅ This tells Apache to internally map the clean URL to the PHP file with the correct employee_id parameter.
Technical Best Practices
- Always use a trailing slash consistently (or rewrite to enforce it).
- Use hyphens – instead of underscores _ for separating words in URLs.
- Ensure URLs return appropriate HTTP status codes (e.g., 200 OK or 404 Not Found).
- Use canonical tags to avoid duplicate content issues.
When to Use Pretty URLs
Pretty URLs are especially useful for:
- Booking systems Example: /booking/my-bookings/123 for employee-specific booking history
- E-commerce product pages Example: /products/organic-honey-500g
- Blog posts and articles Example: /blog/seo-pretty-url-benefits
Final Thoughts & SEO Advantage
Clean URLs like /booking/my-bookings/{employee_id} are a small but powerful step toward better SEO. They enhance both usability and discoverability, making your site more professional and more accessible to both users and search bots.
By implementing the simple RewriteRule, you’re not only optimizing your code structure — you’re also laying the foundation for scalable, SEO-optimized URLs across your entire platform.
Need Help?
If you’re building a multilingual or multi-hotel booking system and want to implement Pretty URLs with SEO optimization, feel free to contact our web development team.
📞 Tel: 062-851-8111
📱 LINE: https://lin.ee/Jtntn5h
🕒 Open daily 09:00–18:00