Oprano Front Page


Go Back   Oprano Adult Industry Forums > The Business Of Porn - Closed For Posting > Legacy Archived Main Board

Notices

Legacy Archived Main Board Business chat and general industry chat. All participation is welcome. Dont post your fucking spam here.





Check Out YnotMail

The Original Oprano Flat Board (Thanks To Sarettah!)---
Oprano Swag Shop
"History Of Porn Timeline
Reply
 
Thread Tools Display Modes
Old 11-03-2002   #1
SmutNames
Members
 
Join Date: Oct 2002
Posts: 13
Default

Hey Guys,

Im trying to get modrewrite to automatically redirect domain names based on the name without having to do any setting up in the httpd.conf.

What i mean i have domain1.com

By default when that hits the server it should go to /www/hosts/domain1.com without having to setup anything specific for that domain.

Now ive got it mostly sorted out... and it works.. if somebody types in www.domain1.com or http://www.domain1.com or even http://www.domain1.com/bullshit/8768768.htspujy

But i can't get it to work with just http://domain1.com

Heres a copy of the modrewrite code i have at the moment.. if anybody knows much about modrewrite i would LOVE if you could help me with this

RewriteEngine On

# a ServerName derived from a Host: header may be any case at all
RewriteMap lowercase int:tolower

## deal with normal documents first:
# allow Alias /icons/ to work - repeat for other aliases
RewriteCond %{REQUEST_URI} !^/icons/
# allow CGIs to work
RewriteCond %{REQUEST_URI} !^/cgi-bin/

# do the magic
RewriteCond ${lowercase:%{SERVER_NAME}} ^.*\.[a-z-]+\.com$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
# now create the real file name
RewriteRule ^.*\.([a-z-]+\.com)(.*) /www/hosts/$1/$2

## and now deal with CGIs - we have to force a MIME type
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ^.*\.([a-z-]+\.com)(.*) /www/hosts/$1/$2 [T=application/x-httpd-cgi]
__________________
Plenty of domain names, if ya need any message me :)
SmutNames is offline   Reply With Quote
Old 11-03-2002   #2
Edd
Members
 
Join Date: Oct 2002
Location: Deadwood, you Cocksucker!
Posts: 833
Default

Quote:
Originally posted by SmutNames@Nov 3 2002, 06:33 AM

RewriteEngine On

# a ServerName derived from a Host: header may be any case at all
RewriteMap lowercase int:tolower

## deal with normal documents first:
# allow Alias /icons/ to work - repeat for other aliases
RewriteCond %{REQUEST_URI} !^/icons/
# allow CGIs to work
RewriteCond %{REQUEST_URI} !^/cgi-bin/

# do the magic
RewriteCond ${lowercase:%{SERVER_NAME}} ^.*\.[a-z-]+\.com$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
# now create the real file name
RewriteRule ^.*\.([a-z-]+\.com)(.*) /www/hosts/$1/$2

## and now deal with CGIs - we have to force a MIME type
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ^.*\.([a-z-]+\.com)(.*) /www/hosts/$1/$2 [T=application/x-httpd-cgi]
Smutnames -

I've got an idea for you to try - seems you have only one rule -
RewriteRule ^.*\.([a-z-]+\.com)(.*) /www/hosts/$1/$2

which, if I'm reading it right says to take
whatever.whatever.com and redirect it - so make another rule
and drop the first whatver, and put the rule just after the first one!
RewriteRule ^.\([a-z-]+\.com)(.*) /www/hosts/$1/$2

just a though - my modrewrite skills aren't that sharp...

tryHERE and HERE for more infos!
__________________

You can't just cut the throat of every Cocksucker who's character it MIGHT improve!
Edd is offline   Reply With Quote
Old 11-03-2002   #3
SmutNames
Members
 
Join Date: Oct 2002
Posts: 13
Default

Hmm.. tried it.. didn't work..

Its strange, how its just that i can't get to work.

Guess ive got to get myself an apache / modrewrite expert to help me out on this one

It's allready beyond my skills
__________________
Plenty of domain names, if ya need any message me :)
SmutNames is offline   Reply With Quote
Old 11-07-2002   #4
tinnitus
Guest
 
Posts: n/a
Default

Quote:
RewriteRule ^.\([a-z-]+\.com)(.*) /www/hosts/$1/$2
That is close but not quite right -- this regular expression starts with:

^ = beginning of line
. = any single character
\( = a literal "(" character

The regular expression you want to match for "domain.com" is:

^([a-z]+\.com)(.*)

If you can't make sense of this, I can fix for you on your machine, please IM me (ICQ #21483582) -- it shouldn't take more than 5 minutes.
  Reply With Quote
Old 11-07-2002   #5
Edd
Members
 
Join Date: Oct 2002
Location: Deadwood, you Cocksucker!
Posts: 833
Default

hey thanks tinnitus! I thought I'd shaved off the right part but I guess I ws a few short!
__________________

You can't just cut the throat of every Cocksucker who's character it MIGHT improve!
Edd is offline   Reply With Quote
Reply

Bookmarks


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 On
HTML code is On
Forum Jump


All times are GMT -4. The time now is 06:36 AM..


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Evil Empire Inc. 2006-2022