Jump to content

Recommended Posts

How do you name your pages like this?:

www.mysite.com/?pageid=1

www.mysite.com/?pageid=2

 

Instead of the normal way:

www.mysite.com/page1.php

www.mysite.com/page2.php

 

Also, what are  the advantages/disasdvantages of this and how does this effect the way search engines view the page?

Link to comment
https://forums.phpfreaks.com/topic/91018-questions-about-page-naming/
Share on other sites

just make the index.php get the $_GET variables

example:

 

index.php

<?php

echo $_GET['page'];

?>

 

then go to http://www.yourwebsite.com/?page=home

 

 

 

i dont know how it affects the search engines,

but i've heard that some search engines do not

index pages with variables in the URL.

The page naming is actually:

 

http://www.mysite.com/index.php?page=2

 

It's called "dynamic" paging...and basically you're just sending at $_GET variable to the index page over and over again to tell it which .php (or .html or other) file to load for content.

its up to you.

 

you can do something like this:

 

<?php

switch($_GET['page']){
	case 1: // If index.php?page=1
		include('page01.php'); // you can change the value to the name of the page
	break;
	case 2: // If index.php?page=2
		include('page02.php'); // you can change the value to the name of the page
	break;
	// etc.....
}

?>

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.