PDA

View Full Version : htaccess help needed


mybimmer
06-21-2009, 05:28 AM
I have been struggling with the .htaccess for my websites for several weeks. Many sites have given great tips. My problem comes from the fact that I have to combine several of the tips together--that usually create havoc.

Here is my basic issues:

1. Wordpress blog in a /blog directory for the main site. Needs to be able to send requests for main site to that directory for the blog.

2. Photo gallery accessable from blog and my other sites need to be able to get to /gallery22 directory. I also have many extrenal links into the gallery from other websites.

3. Additional domain needs to be able to access a subdirectory /subsite2 directory.

4. Direct numerous other vanity domains to the main website /blog area.

I would appreciate any help you can give me on this issue. Below is the code I have been working with.


Options +FollowSymLinks
rewriteEngine on
#
######################### BEGIN REDIRECT FOR SUBSITE2.COM
#
rewriteCond %{HTTP_HOST} ^www.SUBSITE2.com [NC]
rewriteCond %{HTTP_HOST} ^SUBSITE2.com [NC]
rewriteRule ^(.*)$ http://www.MAINSITE.com/SUBSITE2/ [L,R=301]
#
######################### END REDIRECT FOR SUBSITE2.COM
#
#
######################### BEGIN REDIRECT FOR MAINSITE.COM BLOG
#
###########rewriteCond %{HTTP_HOST} ^www.MAINSITE.com [NC]
###########rewriteRule ^(.*)$ http://www.MAINSITE.com/blog/index.php [L,R=301]
#
###########rewriteCond %{http_host} ^(www\.)MAINSITE\.com [NC]
###########rewriteCond %{REQUEST_URI} !^/blog/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
#
######################### END REDIRECT FOR MAINSITE.COM BLOG
#
#
######################### BEGIN REDIRECT FOR MAINSITE.COM GALLERY VERSIONS (2 & 22) (http://MAINSITE.com/gallery22)
#
######################### END REDIRECT FOR MAINSITE.COM GALLERY VERSIONS (2 & 22) (http://MAINSITE.com/gallery22)
#
#
######################### BEGIN REDIRECT FOR MAINSITE.COM ABOUT US VIA WORDPRESS PAGE (http://MAINSITE.com/?page_id=75)
#
######################### END REDIRECT FOR MAINSITE.COM ABOUT US VIA WORDPRESS PAGE (http://MAINSITE.com/?page_id=75)
#
#
######################### BEGIN CUSTOM ERROR PAGES
#
#errorDocument 400 /errors/error.html
#errorDocument 401 /errors/error.html
#errorDocument 403 /errors/error.html
#errorDocument 404 /errors/error.html
#errorDocument 500 /errors/error.html
#
######################### END CUSTOM ERROR PAGES