Forum Moderators: phranque
I have been using a .htaccess file successfully on two linux servers.
I have now moved the file to streamline hosting and am getting unexpected behaviour.
File:
RewriteEngine onRewriteCond %{HTTP_HOST} ^www\.(realsite¦devsite)\.(net¦com)$ [NC]
RewriteCond %{REQUEST_URI}!^/(includes¦images¦js¦style)/ [NC]
RewriteRule ^(.*)$ http://www.%1.%2/includes/aFile.php?uri=%{REQUEST_URI}
Am I right in thinking that this should send all users to the file mentioned but NOT actually redirect them?
There is no [R] flag and so, as it does on the first two servers it should send the request to the file mentioned but the user should still see the original requested url?
OR am I doing something wrong?
Thank you.
Domain names and hostnames are essentially meaningless inside a server, once the requested domain has been resolved to a virtual host. So you should be specifying an internal server filepath to the 'space' you want to access, and not a URL.
Jim
I now have it working using the following:
RewriteEngine onRewriteCond %{REQUEST_URI}!^/(includes¦images¦js¦style)/ [NC]
RewriteRule ^(.*)$ /includes/aFile.php?uri=%{REQUEST_URI}
I wasn't aware a protocol (such as [)...] would also invoke a redirect.