Bypassing Mod_rewrite

Bypassing Mod_rewrite

Posted by: kblessing
Posted on: 2008-07-21 16:10:00

Hello, I got this .htaccess setup on gwcmayhem.com

In reply to:


Options +FollowSymLinks

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^(www|webmail|ftp|mail|stats|mailboxes)\.gwcmayhem\.com [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.gwcmayhem\.com$ [NC]
RewriteRule ^.*$ /home/kblessing/gwcmayhem.com/view.php?member=%1 [L]

RewriteRule ^~(.*)/avatar.jpg /avatar.php?id=$1 [L]
RewriteRule ^~(.*)/(.*).jpg /userimg/$1/$2.jpg [L]



Basically it does what I want in regards of the subdomain passing it on to view.php

But I would like it if every other path (ie: if theres actually something behind the domain's / ) was treated as if it was on the main site.

For example if I do an image source of /~1/image.jpg I'd like to be able to do it just like that instead of http://www.gwcmayhem.com/~1.... having to spell out the entire domain of the main site just to load images, CSS, other scripts, javascript, etc.


-Karl Blessing

Re: Bypassing Mod_rewrite

Posted by: Atropos7
Posted on: 2008-07-21 22:02:00

In reply to:

For example if I do an image source of /~1/image.jpg I'd like to be able to do it just like that instead of http://www.gwcmayhem.com/~1.... having to spell out the entire domain of the main site just to load images, CSS, other scripts, javascript, etc.


Try adding a RewrtieCond with a test for a URL that matches "/"

ie
RewriteCond %{REQUEST_URI} ^/$

cool openvein.org -//- One-time $50.00 discount on DreamHost plans: Use ATROPOS7

Edited by Atropos7 on 07/21/08 10:05 PM (server time).

Tags: karl blessingrewriteruleimage jpghost wwwmailboxessubdomainavatarreplyscripts