DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Linux Servers and Apache (http://www.daniweb.com/forums/forum33.html)
-   -   mod_rewrite not working help, please (http://www.daniweb.com/forums/thread91310.html)

ukndoit Oct 1st, 2007 10:29 am
mod_rewrite not working help, please
 
Can someone tell me what this code does not work:
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/?web
RewriteRule ^/?(.+) /web/$1 [L]

I am trying to get it where if someone visits any file that does NOT exists:
http://www.domain.com/usernameHere
it would just load http://www.domain.com/web/usernameHere
We added the first two conditions so if the page calls an image it should work because the condition would fail, also if they called a directory on the website it would fail because it exists... othe than that everything else should be redirected.

It does not work, do you see any errors?
Thank you.
Richard

fanaticweb May 1st, 2008 1:52 pm
Re: mod_rewrite not working help, please
 
hi Richard,

What if u try this code instead:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/?web
RewriteRule ^(.*)$ /web/$1 [P,QSA,L]


All times are GMT -4. The time now is 10:57 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC