Re: mod_rewrite
| From: | bvr | Date: | Fri, 01 Mar 2002 19:36:33 +0000 |
| Subject: | Re: mod_rewrite | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-86833@lists.php.net to get a copy of this message | ||
Hello,
I don't know about mod_rewrite, but I do know that most ISP
don't like to change server configuration, it's worth a try though.
You can also do it with IP based virtual hosting, if your ISP supports that.
In this case:
1) Add a wildcard entry for *.yourhost.com to your dns pointing at the ip address of your virtual host.
IP based virtual hosting (as opposed to name-based) can be achieved in Apache's
httpd.conf by *not* including a 'NameVirtualHost' directive for that address.
Basically, all URLs now end up at the same website.
2) Edit the VirtualHost in your httpd.conf and create and alias for the / (root) location. This can be done with the 'Alias' directive.
example:
Alias / /home/mysite/mysite.phpNow all requests come in through this script, and you can do the rest from PHP (by looking at HTTP_HOST and QUERY_STRING). 3) No search engine issues.. In fact you now can easily get rid of ? 's in your URLs.. Unfortunately, in your case you will have to convince your ISP to change this for you, but at least this solution doesn't involve installing software and has no affect on other websites running on the same server (besides having to restart Apache once). Well, about MySQL, there are plenty of resources out there about MySQL's scalability. Personally I think you shouldn't worry too much about it (that's your ISP's job), unless you're really expecting millions of hits/day ofcourse. bye, bvr.
I'm building a website buider app and I'm giving users a url of the form username.mysite.com but I want to redirect all url's that end with mysite.com to a script and query the db based on username.I've learned that I need to use mod_rewrite for this.The documentation suggests that this will cause extra load on the cpu.should I be worried about this? I'm hosting with a third party.What will their reaction to this be. Has anyone done this sort of thing and is it advisable. I don't want to redirect from a 404 page as there's a search engine issue with that. As a side issue,there may be a lot of database updating involed in the site and i'm wondering should i use mysql(i am at the moment). any real world examples of the performance of mysql?I know it's great for
selects. Thanx adrian murphy