HTACCESS Rewrite problem

Posted by TiuTalk on Server Fault See other posts from Server Fault or by TiuTalk
Published on 2010-04-12T23:05:58Z Indexed on 2010/04/12 23:13 UTC
Read the original article Hit count: 259

Filed under:
|
|

I have this folder structure:

/var/www/mysite/abc/
/var/www/mysite/def/
/var/www/mysite/fgh/
/var/www/mysite/ijk/
/var/www/mysite/portal/
/var/www/mysite/wyz/

Today's my server is redirecting all requests of www.mydomain.com to www.mydomain.com/portal and that's ok...

But I want to modify this behavior and keep www.mydomain.com acessing the /var/www/mysite/portal/ folder on background while www.mydomain.com/abc/ still acessing the /var/www/mysite/abc/ folder as before.

That's what i've tried without sucess on my htaccess:

IndexIgnore *
Options +FollowSymlinks

<IfModule mod_rewrite.c>
    RewriteEngine On
    #This doesn't work!!!
    #RewriteCond %{REQUEST_URI} !^abc
    #Neither this :\
    #RewriteCond %{REQUEST_URI} !^/abc
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteRule ^$ /portal/index.php [L]
    RewriteRule . /portal/index.php [L]
</IfModule>

All requests keep goin to www.mydomain.com/portal/ when I use this .htaccess (with or without the commented lines)

© Server Fault or respective owner

Related posts about apache

Related posts about mod-rewrite