To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > Linux/Unix Help

Linux/Unix Help Help with server-side Linux and Unix issues

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-14-2002, 12:36 AM   #1
jennides
Member
 
Join Date: Sep 2002
Posts: 43
mod_rewrite help PLEASE

I am complete novice when it comes to apache so I am hoping someone can offer me some advice.

What I am trying to do is modify my server (I'm on a shared machine so don't have root access. I have to use an .htaccess file) so that anything.mydomain.com resolves to www.mydomain.com

The tech support guys said it could be done with mod-rewrite and gave me the URL to the appropriate section of the apache manual, but that's where their support ended.

I've read through that part of the manual a couple of times but I can't make heads or tails of it.

Can anyone help?

JeNNiDeS
jennides is offline   Reply With Quote
Old 10-14-2002, 12:01 PM   #2
dotwebbie
Expert at something . . .
 
Join Date: Aug 2002
Posts: 287
Boy, I'm lucky. My host will give me wildcard dns without my intervention. Okay, enough on that. What is the url they gave you?
dotwebbie is offline   Reply With Quote
Old 10-14-2002, 02:07 PM   #3
jennides
Member
 
Join Date: Sep 2002
Posts: 43
Well, actually wildcard DNS has been turned on, so they say, but I am required to create individual directories in my /htdocs/ directory in order to activate that subdomain, but this is not at all what I want to do. I simply want whatever.mydomain.com to resolve to www.mydomain.com/index.php

Here's the link to the apache manual on mod_rewrite

http://httpd.apache.org/docs/mod/mod_rewrite.html

Here's what I was recommended to try:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.profitmatic.com$ [NC]
RewriteRule ^(.*)$ http://www.profitmatic.com/$1?subdom=%1


But when trying to access www.mydomain.com it just causes my browser to hang and eventually return "Cannot Find Server error. Also, the URL in the address bar turns to this:

http://www.mydomain.com/www/www/www/...ww/?subdom=www
jennides is offline   Reply With Quote
Old 10-14-2002, 02:43 PM   #4
dotwebbie
Expert at something . . .
 
Join Date: Aug 2002
Posts: 287
Code:
RewriteEngine on
	RewriteCond %{HTTP_HOST}                !^203.31.191.32(:80)?$
	RewriteCond %{HTTP_HOST}                !^www.pseudo.com.au(:80)?$
	RewriteRule ^/(.*)                      http://www.pseudo.com.au/$1 [L,R]
	RewriteOptions inherit
Here is the site. http://list.cobalt.com/pipermail/cob...ch/065703.html
dotwebbie is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 08:22 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.