-3

I was told that using $_GET to fetch content is old school and should use folder path instead for seo purpose.

example

GET

http://domain.com/content.php?id=1

Folder Path

http://domain.com/content/this-is-an-article

How true is this and which 1 should I use?

aviva
  • 85
  • 1
  • 1
  • 6

1 Answers1

0

Both.

Using folder style URLs is better for SEO however behind the scenes these are normally rewritten (using rewrite rules in .htaccess if using apache) to convert them to the appropriate get url.

So

http://domain.com/content/this-is-an-article

would get rewritten behind the scenes to

http://domain.com/content.php?title=this-is-an-article

To users of your website they see/use the folder version of the URL.

An example apache rewrite rule for this would be:

RewriteEngine on
RewriteRule ^content/([^/\.]+)/?$ content.php?title=$1 [L]
Neddage
  • 306
  • 1
  • 7