![]() |
| |||
| Hi, I have a Joomla based CMS website installed in a subdirectory of the root of my public folder. I did this because I wanted to keep the Joomla CMS content organized and separate from the other directories and files that are in the root. Now, I set up a 301 redirection using .htaccess in the root that forwards everything to my subdirectory. I was able to use the code which I found http://www.drichproductions.com/rand...bdirectory.php, which not only does the redirect, but also masks the Joomla folder so instead of http://www.mysite.com/joomla, it just shows http://www.mysite.com as the URL which is exactly what I want (I don't want users having to see the subdirectory appended to the URL). This all works fine except that the redirection breaks access to any files/directories that exist in the root. For example, I have a directory named MP3 that resides in /public_html/MP3 but is now inaccessible due to the rewrite code. I assumed this would be the case as everything would now be redirected to the new "virtual" location. Is there a way to modify the code in the .htaccess file to still allow requests to directories/files that are above the joomla subdirectory level? the code is below *******Start Code************* Options +FollowSymLinks RewriteEngine On RewriteBase / # This section must come first! # Add trailing slash if path does not contain a period or end with a slash RewriteCond %{REQUEST_URI} !(\.|/$) RewriteRule (.*) http://www.yoursite.com/$1/ [R=301,L] #Change http://yoursite.com to http://www.yoursite.com (Optional) RewriteCond %{HTTP_HOST} ^yoursite.com$ RewriteRule ^/?(.*)$ http://www.yoursite.com/$1 [R=301,L] #Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/ RewriteCond %{REQUEST_URI} !^/subdir RewriteRule ^(.*)$ subdir/$1 [L] *********End Code************ I am a noob when it comes to using htaccess and rewrites. I'd also be open to not using htaccess at all and find another way to forward the the traffic while still hiding the URL and making root level files and folders available. As far as I know, my host does not provide any vhost configuration through cPanel. Thanks in advance for any assistance you may be able to offer. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |