alang Posted June 10, 2009 Share Posted June 10, 2009 Hi All, just a bit of an overview to the way my site is at the moment - Currently user's sign up for their own personal area which will be located at mydomain.com/uname. For each signup I create a database for them and manually create the folder and upload the files. This was fine at the start and everything does work perfectly and I have created some scripts to go someway to automating the process but the site now has hundreds of members and if I do an update or add a new feature i have to drag and drop it into each user directory which is now a very tedious task. Now I want to change this and make the site completely dynamic so that the members are all using the same source files. I was thinking that all the current files would need to remain but instead of having content they would just include the file from somewhere one level up so for example mydomain.com/uname/index.php would just contain include '../sourcefiles/index.php' and then to add features or do an update I would only have to update sourcefiles/index.php or whatever file needed updating. I can't help but think that while this would work, there must be a better way to do it?? Can anyone offer any words of wisdom? Thanks for any help given! Quote Link to comment https://forums.phpfreaks.com/topic/161661-making-site-more-dynamic/ Share on other sites More sharing options...
RussellReal Posted June 10, 2009 Share Posted June 10, 2009 if you'd like to hire me to do it for you, that'd be good for me, however, if you want to do it yourself.. You could just put an htaccess file in your main directory like: mydomain.com/ and in there the .htaccess file THEN inside that you do RewriteEngine On RewriteCond %{REQUEST_URI} !-d RewriteCond %{REQUEST_URI} !-f RewriteRule ^(.*)$ user_index.php?query=$1 and then in the PHP to actually parse the string as it could be you use $_SERVER['QUERY_STRING'] and then you get after the 'query=' and then seperate by '=' and then parse them into your own GET array, I think $_POST should still be sent or carried over by the rewrite.. and then in user_index.php you handle all the data, and it WILL simulate the look and feel of your already existing system, except instead of hundreds of folders, you'll just have 1 file accessing 1 folder, or no folders, depending on how you code it Quote Link to comment https://forums.phpfreaks.com/topic/161661-making-site-more-dynamic/#findComment-853026 Share on other sites More sharing options...
alang Posted June 10, 2009 Author Share Posted June 10, 2009 Ok thanks, so we would need a Rewrite rule for every page? It is ecommerce enabled so would this complicate things as users go to paypal and back etc? Quote Link to comment https://forums.phpfreaks.com/topic/161661-making-site-more-dynamic/#findComment-853077 Share on other sites More sharing options...
RussellReal Posted June 10, 2009 Share Posted June 10, 2009 no... just 1 rewrite rule Quote Link to comment https://forums.phpfreaks.com/topic/161661-making-site-more-dynamic/#findComment-853381 Share on other sites More sharing options...
alang Posted June 16, 2009 Author Share Posted June 16, 2009 Will this stop the users individual folders from being indexed by search engines? I'll have to mess around and do a few tests before I can see if this would work for me or not... thanks Quote Link to comment https://forums.phpfreaks.com/topic/161661-making-site-more-dynamic/#findComment-856953 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.