Forum Moderators: phranque
For example, http://user1.example.com should take the browser to http://user1.example.com/profiles/user1/ and this works.
However, I need the URL to stay as http://user1.example.com/.
Below is the .htaccess file in the document root.
Please help!
------------------------------------------------
DirectoryIndex index.php index.html index.htm
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ([^.]+)\.example.com [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule ^$ /profiles/%1
------------------------------------------------
[edited by: jdMorgan at 6:11 pm (utc) on July 18, 2007]
[edit reason] Example.com [/edit]
... then that is a redirect if the browser actually "goes" there.
>> However, I need the URL to stay as user1.example.com/ <<
... then that is a rewrite if the actual filepath remains hidden.
.
Which do you want? A redirect or a rewrite?
You need to be clear on the differences between them.
You also need to be clear that the requested URL and the server filepath/filename are two completely different things.
[edited by: jdMorgan at 6:12 pm (utc) on July 18, 2007]
[edit reason] Example.com [/edit]
What matters is this: Are there any mod_rewrite or mod_alias directives in this .htaccess file (or in .htaccess files in the subdirectories to which this rule rewrites) which would match the rewritten URL and perform an external redirect?
Jim
Here is the full file...
--------------------------
DirectoryIndex index.php index.html index.htm
CheckSpelling On
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule ^$ /blocks/%1
--------------------------
Please advise?
[edited by: jdMorgan at 5:10 am (utc) on July 21, 2007]
[edit reason] example.com [/edit]
If that is not the case, then contact your host -- either they are doing a redirect for some reason, or your server is mis-configured. Redirects don't "just happen," so someone, somewhere, is doing an external redirect that is "exposing" the subdirectory to the client.
Jim