Forcing www and Plogger mod_rewrite

Using a single web hosting account to host multiple sites

Forcing www and Plogger mod_rewrite

Postby D.i M.e » Tue Apr 24, 2007 12:57 pm

Hi everybody!

I don't want to open new topic so I'll explain my problem here.

I have a domain on which my preferred way is with www prefix. So I use code below in my .htaccess file.

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


There are several other codes, but only this one work excellent. (btw, I use it on other domains and there all example.com/something are redirected to www.example.com/something)

So whats the problem, you ask? Well, in one folder I use script Plogger (which is, btw, excellent) for my album. Plogger use this .htaccess file below which is in it's root folder (example.com/album), and it's used for creating so-called "cruft-free" urls:

Code: Select all
# BEGIN Plogger

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /index.php
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [S=2]
RewriteRule feed/$ plog-rss.php?path=%{REQUEST_URI} [L]
RewriteRule ^.*$ index.php?path=%{REQUEST_URI} [L]
</IfModule>
# END Plogger


Because of this (I suppose) redirections are not working in this folder.

On this domain it works example.com/something to www.example.com/something, example.com/folder to www.example.com//folder etc, but doesn't work example.com/album to www.example.com/album or example.com/album/something to www.example.com/album/something (just stay same url example.com/album or example.com/album/something, pages are opening normal).

My question is: is there any way that this can be resolved, because I want to use just url with www and not to have duplicated content. This folder /album brings me lot of traffic from search engines so I want to improve my SEO.

I'll appreciate any help.
D.i M.e
 
Posts: 11
Joined: Tue Apr 24, 2007 11:56 am

Postby richardk » Tue Apr 24, 2007 1:48 pm

Try this in the Plogger .htaccess file
Code: Select all
# BEGIN Plogger

<IfModule mod_rewrite.c>
  RewriteEngine On

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

  RewriteCond %{SCRIPT_FILENAME} -d [OR]
  RewriteCond %{SCRIPT_FILENAME} -f
  RewriteRule .* - [L]

  RewriteRule feed/$ plog-rss.php?path=%{REQUEST_URI} [L]
  RewriteRule .*     index.php?path=%{REQUEST_URI}    [L]
</IfModule>

# END Plogger
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby D.i M.e » Tue Apr 24, 2007 2:25 pm

Yes! It's working! Thank you very much! I'll see if there will be some problems later.

Just to notice: I didn't touch root .htaccess, only one in Plogger folder.
D.i M.e
 
Posts: 11
Joined: Tue Apr 24, 2007 11:56 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 99 guests

cron