- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteCond %{REQUEST_URI} !^/domain.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /domain.com/$1 [L]
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$ [NC]
RewriteRule ^(/)?$ domain.com/index.php [L]
Now, everything works fine if i am simply browsing the site, even with Joomlas SEF URL's, but for some reason if i try and access a folder.. lets say /test the URL changes to.. http://domain.com/domain.com/test/ - but, if i add a trailing slash after the folder or directory name like this... http://domain.com/test/ it works just fine! Now this isnt essential, but i would be interested to find out what the issue is.. I think it may have something to do with the following peice of code (which i have been using to add force a www)
- Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
Apart from that, I wonder if anyone has experienced something to the following, just thinking.... With the same setup as mentioned above, after moving files from the public_html folder into public_html/domain.com/ I have now had to go through and change any redirect lines in my .htaccess like so... from:
- Code: Select all
Redirect 301 /web-design.html /web-design/
- Code: Select all
Rediect 301 /domain.com/web-design.html /web-design/
Let me know what you think, even though there is no major issue, I am keen to find out how to fix it, and learn more about the system! Thanks, fellas, much appreciated.. and hope my post wasnt too confusing , J