I am working on one project. It has lots products in it.
When I publish any product system just write the SEO friendly/slugify URL into htaccess file as like below.
The above mentioned URL is just slugify URL based on manufacturer and product title.
System doesn’t have any folders like ‘samsung’ or ‘frigidaire’ as you can see in above given URLs.
System writes this kind of URL’s for all the published products.
It will be big problem in future due to large number of “RewriteRule” entries in htaccess file.
Is there any solution for this kind of issue/problem? I have no problem if htaccess file have one regular expression for this kind of URL’s to handle.
Currently, following platform we used.
PHP 7
MYSQL
Apache server
Linux Operating system
Please share your thoughts.Any kind of help will be great appreciates.
If you are using Wordpress, there is an old Redirection plugin that works well. It writes the rewrite as a custom post so it doesn’t litter up a mod_rewrite, and doesn’t have the same kind of limitations as a normal rewrite.
If you are not using Wordpress, what CMS or framework are you using? that is usually where routing is done (in the app, not at the server). Each framework/CMS has its own system, or plugins, which can handle rewrites.
Well, that means you are “re-inventing the wheel” so to speak. There may be some library somewhere to do what you want, but the reason there are frameworks and cms in the first place is to make these kinds of routine routing and page compositing tasks easier to deal with. If you don’t want something heavyweight, then find a lightweight system that does the bare minimum. Build from scratch is something one might do in a CS course in order to learn the basics, or for a very small project, but for production systems it makes much less sense in terms of developer time.