Forum Moderators: phranque
RedirectMatch permanent ^/$ http://forum.example.co.uk/portal.php
this appears to work fine , however i have noticed that the instant redirect is causing browsers to skip the index.html file ,, there is nothing in my index.hmtl file that my users need to see but it contains my keywords/title/description tags .. although my users do not need this information ,, search engines DO so i was wondering if there is a line i can add to my .htaccess file that will force browsers to aknowledge the index.html file before it redirects...
PS: <meta refesh> and javascript redirects are NOT an option for me
PPS:Sorry for the long post but this is driving me mad.
[edited by: jdMorgan at 8:17 pm (utc) on July 26, 2004]
If you cloak, remember that you are going against the TOS of the SE's (may not matter, may not mean anything), but you will be serving different content to humans and spiders.
Well...I guess you have a third option.
If you are not wanting to take the risk of cloaking or replace your index page with your portal page, you may want to consider removing the redirect and keeping the index page and simply allowing your visitors to click on a link to be taken to the portal page.
Surely it would be much easier to set portal.php as the directory index, meaning that it will be loaded by default when you go to your home page. If there are other directories on the site where you are using a standard index.php or index.htm file, then you can just specify them afterwards in the directive:
DirectoryIndex portal.php index.php index.htm Otherwise, if there is no index.php in the document root, then you can just create the file with nothing but a 301 Permanent Redirect to portal.php.
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: portal.php");
exit;
?>
Much better than messing with mod_rewrite or RedirectMatch, which are overkill for this situation.
You should add your titles and keywords to your portal.php page and forget the old index page, which is functioning as a kind of "doorway" page and is a good way to get you banned.
there is nothing in my index.hmtl file that my users need to see but it contains my keywords/title/description tags ..
although my users do not need this information , search engines DO so i was wondering if there is a line i can add to my .htaccess file that will force browsers to aknowledge the index.html file before it redirects...
Either way you decide to do it, it will be against the TOS of the engines but that's the risk you take, eh?
Me, I'll stick to the rules and actually put the keywords and stuff on the page that the users sees, whether they 'need' it or not. If it's relevant text, why not include it. If it's not relevant and you do include it, you're trying to cheat the system and therefore are taking a risk.