Forum Moderators: phranque
www.mydomain.com/index.php
to
www.mydomain.com/
(or the other way around).
The purpose of this is we have high quality inbound links going to a mixture of both, and we want to concentrate the PR onto one link, rather than have it spread over two.
As I understand it google allocates PR on a link basis, so even though these two URL's both resolve exactly the same page, they will be calculated individually.
So we put this into .htaccess:-
redirect 301 /index.php h*tp://www.mydomain.co.uk/
And it doesn't work - won't resolve the index page at all (looks rather like it's getting stuck in a loop).
Any ideas?
Many thanks,
TJ
Redirect 301 /index.php http://www.mydomain.co.uk/
Captital 'R' ;)
I had awful trouble with this when I had to do it but this page [httpd.apache.org] has a capital R but is otherwise the same as you have.
You could also try:
Redirect permanent /index.php http://www.mydomain.co.uk/
Nick
You may want to try mod_dir [httpd.apache.org]:
DirectoryIndex index.php
That line would go in your .htaccess file and then you won't need the redirect. Now any request for a dir(eg. site.com/foo/ or site.com/) will automatically serve index.php.
If none of the above work, the following method may break the "loop":
1) Rename your index.php file to main.php.
2) In .htaccess, place:
Options -Indexes
DirectoryIndex main.php
RedirectMatch ^/index\.php$ http://www.yourdomain.com/
Never refer to your index file as anything other than "/" in any link, internal or external. Leave the redirect in place and stick with the "main.php" name for at least 6 months - make sure the search engines all update their listings to show your home page as "yourdomain.com/" (Ink's Slurp is usually very slow). After that time, you can take out the .htaccess code, rename the page back to index.php, and change DirectoryIndex back to point to index.php if you want to.
See Apache [httpd.apache.org] core, mod_dir, and mod_alias.
HTH,
Jim