htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help with htaccess for subdirectory holding wordpress
PostPosted: 18 Aug 2007 10:25 
Offline

Joined: 18 Aug 2007 08:40
Posts: 2
Location: San Diego
:D Howdy,
First off, I am glad to have found a place to ask for htaccess help. If you can help me out with this, I am more than happy to make a donation towards the site!

My site currently uses this htaccess file, and it works fine.

============================================
RewriteEngine On

redirect 301 /BWP/ http://www.example.com/bwp/
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /bwp/index\.php\ HTTP/
RewriteRule ^BWP/index\.php$ http://www.example.com/bwp/ [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

<IfModule mod_rewrite.c>
RewriteBase /bwp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bwp/ [L]
</IfModule>

redirect 301 /Blog/00-Chiropractic-Blog-List.html http://www.example.com/bwp/
redirect 301 /Blog/061119-Google-San-Diego-Chiropractic.html http://www.example.com/bwp/2006/11/goog ... ropractic/
=============================================

I have a wordpress blog installed at:
http://www.example.com/bwp/
Everything works great with the htaccess

I just installed a second wordpress blog at
http://www.example.com/gwp/

I put the following htaccess file in the example.com/gwp/
directory.

============================================

RewriteEngine On

redirect 301 /GWP/ http://www.example.com/gwp/

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /gwp/index\.php\ HTTP/
RewriteRule ^GWP/index\.php$ http://www.example.com/gwp/ [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

<IfModule mod_rewrite.c>
RewriteBase /gwp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /gwp/ [L]
</IfModule>

redirect 301 /gwp/2007/08/sample-2007/ http://www.example.com/gwp/2007/08/sample-2/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /gwp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /gwp/index.php [L]
</IfModule>

# END WordPress

============================================

The URLs are all turning out o.k. on the new blog at example/gwp/
except for the following.

If I open firefox and enter:
example.com/gwp/
into the address bar, it gets redirected to:
http://www.example.com

If I enter
http://www.bodyabcs.com/gwp/
it simply opens up the blog correctly.

I have been reading and studying htaccess, but it still confuses the bageebiz out of me.

I would love some help!
Thanks so much!
dk


:P



dk


Top
 Profile  
 
 Post subject: Re: Help with htaccess for subdirectory holding wordpress
PostPosted: 20 Aug 2007 15:22 
Offline

Joined: 30 Oct 2006 19:55
Posts: 99
purposeinc wrote:
I have a wordpress blog installed at:
http://www.example.com/bwp/
Everything works great with the htaccess

I just installed a second wordpress blog at
http://www.example.com/gwp/


I would love some help!
Thanks so much!
dk


:P



Try this.. let me know if it works!

Code:
Redirect 301 /Blog/00-Chiropractic-Blog-List.html http://www.example.com/bwp/
Redirect 301 /Blog/061119-Google-San-Diego-Chiropractic.html http://www.example.com/bwp/2006/11/google-san-diego-chiropractic/
Redirect 301 /gwp/2007/08/sample-2007/ http://www.example.com/gwp/2007/08/sample-2/
RedirectMatch 301 /BWP/(.*) http://www.example.com/bwp/$1

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

RewriteBase /bwp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bwp/index.php [L]

RewriteBase /gwp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /gwp/index.php [L]


Top
 Profile  
 
 Post subject:
PostPosted: 21 Aug 2007 08:33 
Offline

Joined: 18 Aug 2007 08:40
Posts: 2
Location: San Diego
It turned out that I needed to change
RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]
to
RewriteRule index\.html$ http://www.example.com/bwp/%1 [R=301,L]

Or if that was not it exactly it was very close. I wan in a hurry so I got help at rentacoder. I greatly apreciate your help!

dk



dk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB