Forum Moderators: phranque
Here is the code in the .htaccess file in the root httpdocs folder:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/store/
RewriteRule ^(.*)$ /store/$1 [L]
This is the URL for the root: [store.example.com...] where this is pointing.
Any help will be really appreciated.
[edited by: jdMorgan at 1:36 pm (utc) on May 22, 2009]
[edit reason] example.com [/edit]
Be aware that mod_rewrite will base its decision to invoke the rewrite only on the URL requested by the client, so *some* information must be carried in the requested URL that will allow it to make the correct decision;. In other words, you can't write the code to rewrite *all* requested URL-paths to the /store/ filepath, and then expect to be able to access root unless there is something distinct about "root URLs" that you can tell mod_rewrite to identify and use to inhibit the rewrite.
Jim
I tried replace it with this code but it gave a server error message:
RewriteCond %{REQUEST_URI} !^/store/merchant.mvc
RewriteRule ^(.*)$ /store/merchant.mvc$1 [L]
# Rewrite requests for merchant.mvc and admin.mvc to /store/merchant.mvc and /store/admin.mvc
RewriteRule ^(merchant¦admin)\.mvc$ /store/$1.mvc [L]
The RewriteCond is no longer needed, since the rewritten filepath will no longer match the URL-path pattern.
Jim