Hi, my first post here, greets everyone, and thanks for any help in advance.
I've been messing with the following for some weeks but I would need some help with an issue if someone can. I have setup the primary domain on a host to point to a subdirectory of public_html using various of methods, I will show 2 of those that both work great except a small issue.
Method 1:
I entered the following code in the /public_html/.htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/__subdirectory
RewriteRule ^(.*)$ /__subdirectory/$1 [L]
Method 2:
I entered the following code in the /public_html/.htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteCond %{REQUEST_URI} !^/__subdirectory/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /__subdirectory/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ __subdirectory/index.php [L]
so, ..in /__subdirectory/ I got a Joomla installation (with SEF urls enabled) and any of the above methods works, except that if I enter in the url this: [
domain.com...] (images directory exists), then the url becomes [
domain.com...]
In a way this exposes the subdirectory name on url, and am not sure what other this might cause especially concerning seo. To solve this I thought of forcing to always add a trailing slash at the end of every url using the following code before the above:
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://www.domain.com/$1/ [R=301,L]
This way the /__subdirectory/ went away from the url, but now I cannot use a very cool feature of the SEF component that I use on a lot on sites called “Aliases” feature. They just don't work.
I have been searching on google to find a way to remove the /__subdirectory/ from the url but nothing worked so far. Any help would be greatly appreciated.
P.S
I got a question on this too, later I plan to add an ssl to the primary domain, will all this cause problems with the ssl etc ?
Thanks a lot
cheers