Follow us on Twitter!
Understanding is the answer, hatred is the problem, and hackers are the slaves abused and destroyed in the process of peace online - Deshouleres
Thursday, September 03, 2015
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Members Online
Total Online: 18
Guests Online: 15
TeamSpeak Online : 5 Members Online: 3

Registered Members: 89941
Newest Member: s4dn3s
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge


Mod_rewrite help


Posts: 144
Location: Finland
Joined: 08.08.06
Posted on 03-11-08 16:20
Anyone good with Apache mod_rewrite?
Or do you know where I should look for help?

Anyway here's my problem:

I want to show different content if a cookie is matched so I do this:

RewriteEngine on
Options +FollowSymLinks

RewriteCond %{HTTP_COOKIE} .*site=i.* [NC]

So far so good. Everything works to this point, but the problem comes with the RewriteRule.

My webhost is structured like this:
/home/user/ and then the user's contents
I have made it so that my main domain goes to /home/user/public_html/

Also the .htaccess file I use is in /home/user/public_html/.htaccess

Now if I wanted to (internally, so that it won't change the URL) redirect all requests to /home/user/public_html/isite/, (which could be represented as, it will redirect indefinitely because the cookie is still there and the .htaccess checks for it. Another option would be to redirect all requests to /home/user/isite/ which would be much better, but I can't get it to work :S I have tried to modify the path with RewriteBase, which gave 500 internal server error, and with ../, which gave bad request error. Any suggestions?

EDIT: Argh, noone ever replies in my threads :P Anyway I got it working with a [NS] flag. Still can't get the second option working though :/

EDIT2: It didn't work after all...

Edited by Mouzi on 03-11-08 18:19
You would try to hack it anyways.