jakubsnm Posted July 9, 2009 Share Posted July 9, 2009 My software had all default homepage links with .../index.php so i changed them all to mysite.com/ I bought a mod for the software which allows you to modify all meta tags for pages in you site, except now that i've killed the ../index.php (even with the robots.txt file) i need a simple script that says. if page = homepage < meta keywords "bla bla" meta description "bla bla" > Love whoever can help me with this... Quote Link to comment Share on other sites More sharing options...
SuperBlue Posted July 11, 2009 Share Posted July 11, 2009 That can be done using a PHP if statement. I would recommend that you simply echo out a variable, containing the keywords for the relevant page. I.e <?php // -----Variables----- $requested_path = $_SERVER['REQUEST_URI']; $HTML['MetaKeywords'] = 'html, css, php, and, so, on'; // FrontPage Keywords if ($requested_path !== '/') { $HTML['MetaKeywords'] = 'blah, blah'; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>My first Website</title> <meta name="keywords" content="<?php echo $HTML['MetaKeywords']; ?>"> </head> <body> <p>My first Website.</p> </body> </html> The above is a nice example, you should however note that the keywords meta tag is obsolete in Google. You may also want to consider getting the keywords from your database, how to do that is beyond this post. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.