mod_rewrite crashes the server

New to mod_rewrite? This is a good place to start.

mod_rewrite crashes the server

Postby ainars » Sun May 11, 2003 4:13 am

I have a strange problem with my server. Usally my server's load is under 0.1-0.7. Some time ago I noticed that several times per day server's load grows to 50..70..90... Then it's normal again. Sometimes when this happends I can not access my server anymore and I have to call the data center to restart it manually.
Then I removed .htaccess file what i used to create subdomains. The problem is gone.

I don't know what's wrong with mod_rewrite. Please see my .htaccess file below. Is it OK?

I used mod_rewrite for the following purpose: when an user registers and creates a profile at my site, his/her profile is accessible via:
http://www.domain.com/go.php?to=myaccou ... e=username

mod_rewrite was used to access user profiles via subdomain: http://www.username.domain.com.

Most of time it works fine, but sometimes when I try to access some subdomain, nothing loads (I get "page cannot be displayed" error which usually appears when server is down, but my server is not down).

My .htaccess file:
=============
RewriteEngine On
Options +FollowSymlinks
RewriteEngine on

RewriteCond %{HTTP_HOST}!^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST}!^domain\.com [NC]

RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) go.php?to=myaccount&op=userinfo&uname=$1

RewriteCond %{HTTP_HOST} ^www\.[^.]+\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^www\.([^.]+)\.domain\.com(.*) go.php?to=myaccount&op=userinfo&uname=$1
========

Thanks for your help.
Ainars
ainars
 
Posts: 1
Joined: Sun May 11, 2003 4:11 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 30 guests

cron