Jump to content

Recommended Posts

Hi all,

 

Im currently exploring methods to make a website more seach engine friendly. I read that including pages with PHP with '?' is poor for optimisation and do wondered what my other options might be?

 

I currently use the following to include pages into my index.php file:

 

<?php    
    if(!empty($_GET['id']) && file_exists("./$_GET[id].php")){
include("./$_GET[id].php");
     } else {
include("./main.php");
     }
?>

 

Making my hyperlinks look like this:

<a href="?id=main">Link Here</a>

 

I have seen sites have the following in the address bar but am not sure how to achieve it? http://www.somesite.co.uk/some-page

 

Also, is there any better character to use other than '?' ?

 

Sorry for all the questions but I'd like to know what others are doing,

Thans in advance!

Link to comment
https://forums.phpfreaks.com/topic/132115-page-includes/
Share on other sites

Yes, when implemented correctly mod_rewrite is way more SEO friendly, mainly because you can disguise the urls to look like actual pages and not have to use the ? and the = and the & which most search engines do not like.

 

Instead of :

 

http://www.yoursite.com/page.php?h=1&b=2 

 

it is

 

http://www.yoursite.com/page/h/1/b/2.html

 

The .html is not necessary but yea. Using the modrewrite you can parse that data out of there and have a clean looking url.

 

As suggested google has a bunch of tutorials on this and it is fairly easy to implement.

Link to comment
https://forums.phpfreaks.com/topic/132115-page-includes/#findComment-686765
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.