Hi
Im setting up a website where people can start their own shops and the url is http://www.mydomain.com/shops/shop_name
Now i have a simple mod_rewrite rule which directs urls above to the shop_details.php page.
What i need to do is dynamically create new rules because when a shop adds a product, it will look like http://www.mydomain.com/shops/shop_name/product_name
In cases like this, is it correct to edit the .htaccess file on the fly using File Write and add a new rule to the file. Then when a user hits the url http://www.mydomain.com/shops/shop_name/product_name, the new rule will recognise the shop and product and redirect to product_details.php.
I think this method will work, Im just wondering is this the normal/correct way to go about solving a problem like this....
thanks in advance
dynamically rewrite URLs
Moderator: General Moderators
- MindOverBody
- Forum Commoner
- Posts: 96
- Joined: Fri Aug 06, 2010 9:01 pm
- Location: Osijek, Croatia
Re: dynamically rewrite URLs
Why dont you use one of frameworks? Zend have nice modular capabilities, and it is pretty simple to use.