Garayed.com  

Go Back   Garayed.com > Apache Configurations
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-2008, 07:24 AM
joshbilsky@gmail.com
 
Posts: n/a
Default Issue with htaccess redirection

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:09 AM.




LinkBacks Enabled by vBSEO 3.0.0 © 2007, Crawlability, Inc.