-1

My domain mainsite.com is actual pointed to /public_html/ .

But i want to point it to sub-site like /public_html/subsite .

So i tried this :

RewriteCond %{HTTP_HOST} ^(www\.)?mainsite\.com$ [NC]
RewriteRule !^(subsite) /subsite%{REQUEST_URI} [L,NC]

It working fine .

Now 2nd is i have many sub-site/sub-folder under /public_html/subsite like /public_html/subsite/(site1 or others...) .

But when i type mainsite.com/(site1 or others...) then it showing me this url mainsite.com/subsite/(site1 or others...) which i don't want.

I want to hide only /subsite/ from url when user browse.

Debar
  • 11

1 Answers1

2

Read this info about setting up an alias:

https://httpd.apache.org/docs/current/mod/mod_alias.html

The Alias directive allows documents to be stored in the local filesystem other than under the DocumentRoot. URLs with a (%-decoded) path beginning with URL-path will be mapped to local files beginning with directory-path. The URL-path is case-sensitive, even on case-insensitive file systems.

Alias "/image" "/ftp/pub/image" 

A request for http://example.com/image/foo.gif would cause the server to return the file /ftp/pub/image/foo.gif. Only complete path segments are matched, so the above alias would not match a request for http://example.com/imagefoo.gif. For more complex matching using regular expressions, see the AliasMatch directive.