You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Johnny C <ju...@gmail.com> on 2004/11/24 23:31:39 UTC

[users@httpd] URL rewrite or alias?

Here's a quick summary:
DocumentRoot: /var/www/html/

What I want to do: (if possible)

http://localhost/
--> should point to /var/www/html/mywebsite
(instead of the *actual* DocumentRoot)

http://localhost/another
--> should point to /var/www/html/another
(relative to DocumentRoot)

I want my main website to be inside a folder rather
than have it on the root and have other files scattered
all around with other subfolders (http://localhost/another)
that do not even belong to the main website.

I tried 
<IfModule mod_alias.c>  
    AliasMatch ^/$ /var/www/html/mywebsite
</IfModule>
but it doesn't work the way I want it. It works well if the URL
actually ends with
something, like http://localhost/test/ can be aliased as
   
AliasMatch ^/test(.*) /var/www/html/mywebsite$1

So my  question is, am I on the right track? 
Can I tell it that if it ends with JUST a "/" OR if it's just the domain
name and nothing else after it, it should be aliased to somewhere? I
really appreciate any help.thankyou.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] URL rewrite or alias?

Posted by Tim Burden <Ti...@Burden.ca>.
It's not too clear WHY you want to do this, but just change DocumentRoot to
/var/www/html/mywebsite and then
Alias /another /var/www/html/another

----- Original Message ----- 
From: "Johnny C" <ju...@gmail.com>
To: <us...@httpd.apache.org>
Sent: Wednesday, November 24, 2004 5:31 PM
Subject: [users@httpd] URL rewrite or alias?


> Here's a quick summary:
> DocumentRoot: /var/www/html/
>
> What I want to do: (if possible)
>
> http://localhost/
> --> should point to /var/www/html/mywebsite
> (instead of the *actual* DocumentRoot)
>
> http://localhost/another
> --> should point to /var/www/html/another
> (relative to DocumentRoot)
>
> I want my main website to be inside a folder rather
> than have it on the root and have other files scattered
> all around with other subfolders (http://localhost/another)
> that do not even belong to the main website.
>
> I tried
> <IfModule mod_alias.c>
>     AliasMatch ^/$ /var/www/html/mywebsite
> </IfModule>
> but it doesn't work the way I want it. It works well if the URL
> actually ends with
> something, like http://localhost/test/ can be aliased as
>
> AliasMatch ^/test(.*) /var/www/html/mywebsite$1
>
> So my  question is, am I on the right track?
> Can I tell it that if it ends with JUST a "/" OR if it's just the domain
> name and nothing else after it, it should be aliased to somewhere? I
> really appreciate any help.thankyou.
>
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org