Forum Moderators: phranque

Message Too Old, No Replies

.htaccess file advice

         

flanok

8:06 pm on Aug 12, 2007 (gmt 0)

10+ Year Member



Hi Again

I have a html website which I have a .htaccess file to take non wwws to www and index.htm to /, to prevent any duplicate content issues.

But back in January I started a blog.
It orginally did OK, with PR filtering through etc.

Now I have lost PR within the blog pages the exception of the blog homepage.

Then today a thought crossed my mind.

The blog is in PHP, in a seperate folder called /blog/

when I type in example.co.uk/blog/ and example/blog/index.htm

I get the same page, and these both have a pr of 4.

To me that means both pages have been found and I need to send all links to one version of this page.

So do I?
Add another rewrite, but this time php script to my existing .htaccess file in the root directory. If so, do you have a script?

Add another .htaccess file with a php script in to the blog folder

Or simply do a d301 in the existing root .htaccess

Advice needed

Many Thanks

Mark

jdMorgan

1:41 pm on Aug 13, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> To me that means both pages have been found and I need to send all links to one version of this page.

Yes.

I don't understand your statement about "Add another rewrite, but this time php script to my existing .htaccess file in the root directory. If so, do you have a script?"

You need to add redirect code to either example.com/.htaccess or to example.com/blog/.htaccess. This code should redirect direct client requests for /index.html to / in all directories, or redirect (only) direct client request for /blog/index.html to /blog/

Which you should do depends on your server configuration and your preferences. The code has been posted many times [google.com] here.

Jim

flanok

3:05 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



thanks Jim

for the reply.
I have already tried converting the redirect (not rewrite) code that I already had from .html (that is in my existing .htaccess file in the root dir) to .php.

For some reason it did not work.

I will try this other code and change the html to PHP and see if it works

Mark