Follow us on Twitter!
Your life is ending one minute at a time. If you were to die tomorrow, what would you do today?
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 24
Guests Online: 22
Members Online: 2

Registered Members: 82910
Newest Member: toni7
Latest Articles
View Thread

HellBound Hackers | Computer General | General Computer Problems

Author

mod_rewrite htaccess

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 21-08-07 17:05
a friend at work has a problem with .htaccess and i cant seem to work it out, figured i'd pass the buck over to you guys. see if you can solve it.

1 server, 5 websites pointing towards 1 account.

the account has mod_rewrite to change urls like this:
website.com/cricket/index.html
into
website.com/index.php?id=cricket

now thats all fairly simple, easy mod_rewrite rules.

however problem comes when with 1 htaccess file he has to do the following:

websiteone.com/swimming/index.html
websitetwo.com/swim/index.html
websitethree.com/backetball/index.html
websitefour.com/cricket/index.html

so in the actual htaccess file there has to be seperate mod_rewrites per HTTP HOST.

i've tried adding the actual domain into the Rewrite Rule, but it isnt accepted.

suggestions?


http://www.hellboundhackers.org/
Author

RE: mod_rewrite htaccess

spyware
Member



Posts: 4192
Location:
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 21-08-07 17:08
Create 5 different .htaccess'es?



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
[center]�Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?� - Ebert[/ce
Author

RE: mod_rewrite htaccess

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 21-08-07 17:09
in the same dir?

there can only be 1 .htaccess per directory.

[edit] ahh i see what you mean, sry i wasnt clear enough. all 5 websites point to the same hosting account and files.




Edited by Mr_Cheese on 21-08-07 17:11
http://www.hellboundhackers.org/
Author

RE: mod_rewrite htaccess

spyware
Member



Posts: 4192
Location:
Joined: 14.04.07
Rank:
God
Warn Level: 90
Posted on 21-08-07 17:13
Right. Erh, use patterns? I believe there's some sort of pattern-search function in the rewrite rule. You could check for a certain name and then forward to that page, or something.



img507.imageshack.us/img507/3580/spynewsig3il1.png
"The chowner of property." - Zeph
[small]
Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.
- Carl Sagan
[center]�Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?� - Ebert[/ce
Author

RE: mod_rewrite htaccess


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-09-07 07:59
I'm no mod_rewrite expert but looking at my cheat sheet I see you can check against various HTTP headers so if you could check for the url matching the specific regex AND HTTP_HOST.