I gave this a try: RewriteEngine On RewriteCond %{HTTP_COOKIE} !^.*test=test.*$ RewriteRule /inbox$ /index.php RewriteCond %{HTTP_COOKIE} !^.*test=test.*$ RewriteRule /compose-mail$ /index.php RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /inbox$ http://127.0.0.1:22131/ [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /inbox/(.+) http://127.0.0.1:22131/$1 [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /(js/qui.+) http://127.0.0.1:22131/$1 [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /(css/qui.+) http://127.0.0.1:22131/$1 [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /js/soundmanager2-nodebug-jsmin.js http://127.0.0.1:22131/js/soundmanager2-nodebug-jsmin.js [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /sound/soundmanager2.swf http://127.0.0.1:22131/sound/soundmanager2.swf [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /images/favicon.png http://127.0.0.1:22131/images/favicon.png [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /(e/.+) http://127.0.0.1:22131/$1 [P] RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /compose-mail$ /proxy/ RewriteCond %{HTTP_COOKIE} ^.*test=test.*$ RewriteRule /compose-mail/(.+)$ /proxy/$1 Now when the cookie not there, it rewrites the url /compose-mail as /index.php (good!), but when the cookie is not there, it forwards to /compose-mail as /compose-mail/ and I get a 404 error --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx