Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CANEHDN

macrumors 6502a
Original poster
Dec 12, 2005
855
0
Eagle Mountain, UT
I have a site that people will come to and have their usernames in the URL.
www.mysite.com/someusername. If they visit the site with www.mysite.com/canehdn/products it should internally redirect to /replicated/products/.

I'm trying to get it so when people do this apache internally redirects to:
/replicated/ --> dir & files in here. This is what I currently have.

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\/(.+)$ /replicated/$2 [QSA,L]

This is kind of working.

--http://www.mysite.com/canehdn/test/ --> /replicated/test/index.php (Works correctly)

--http://www.mysite.com/canehdn/test/index.php --> /replicated/index.php (Should go to /replicated/test/index.php)

--http://www.mywakeupnow.com/canehdn/ --> doesn't work at all. should go to /replicated/index.php

--http://www.mywakeupnow.com/canehdn/index.php --> /replicated/index.php (Works correctly)

Any help on this would be super appreciated.

Thanks everyone
 
Remove the username from the url all together, store it as a session (salted if you are worried ).

Otherwise you could use a lead string to identify the username as such, something like user_bobd, then use the user_ as the strip point.

just trying to imagine this

PS
--http://www.mywakeupnow.com/canehdn/ --> doesn't work at all. should go to /replicated/index.php
Try commenting out the !-d rewrite, that should get this to work
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.