In fact, you might have to think upside down with mod_rewrite .
The easiest way is to get your PHP to emit rewritten mysite.com/roberts-clothing-store/store/12/3 links .
mod_rewrite will proxy a single-page PHP request for rewrite.php?path=roberts-clothing-store/store/12/3 , which will decode the strong> URL and storeid arguments (here storeid and page ) and dynamically include the correct PHP file , or only for 301 for renamed pages.
A clean solution with mod_rewrite possible, but it is much easier to get right, especially if you do not master mod_rewrite .
the main problem may be with service data , which can be significant, but this is the price of simplicity and flexibility. mod_rewrite much faster
Update:
Other do posts answer the question, but they do not solve the typical duplicate content issue, which is avoided by canonical URLs (and using 301/404 for all of these URLs that look fine but not).
source share