1

I am building a website and I will need to make it SEO friendly so, as it is now, I am using a dynamic website (PHP) and through .htaccess, I am making it appear as if the site has static pages.

To do this, I am redirecting to a php file which then displays the content.

The url looks like: www.mainpage.dk/phpfile-navigationvalue-value.htm

I am using a navigation value inside the page to render it according to which menu item is clicked.

The guy I am building this for says that a url like www.mainpage/something.html is better for SEO purporses than www.mainpage.dk/phpfile-navigationvalue-value.htm. Can anyone come with some input on this matter?

And if the regular static page is better, is there a way to make a dynamic look just like a regular static page?

PS: The reason why I want a dynamic page is that the page is going to be extended with new pages every now and then as well as updated frequently.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Rasmus
  • 177
  • 9
  • 3
    i think its more user friendly than SEO friendly o0 – n00b Mar 09 '11 at 14:31
  • I think "www.mainpage/something.html" is far better than your way, it´s more readable for humans and also better for search engines to understand, why make it difficult? – Tobias Mar 09 '11 at 14:59
  • i think "my" way is even better ;P look:address bar – n00b Mar 09 '11 at 16:21

1 Answers1

1

To make it look like a regular page you could add *.html -> alias.php?alias=*

Then check the aliases and display the proper page from PHP.

Also, how about making it :

www.mainpage.dk/phpfile/navvalue/value/ -> index.php?page=phpfile&nav=navvalue&val=value

I would discourage redirecting to a phpfile, but handle it via index.php?page=* (look line above), or something similar.


Edit:

how htaccess should look

RewriteEngine on
#  [!]for `*.html` -> `alias.php?alias=*`
RewriteRule ^(.*)\.html$ alias.php?alias=$1 [NC]
#  [!]for `/phpfile/navvalue/value/` -> `index.php?page=phpfile&nav=navvalue&val=value`
RewriteRule ^(.*)/(.*)/(.*)(/)?$ index.php?page=$1&nav=$2&val=$3 [NC]
n00b
  • 5,642
  • 2
  • 30
  • 48
  • The first part looks like an idea but the second part is a no go. The guy im working for working with seo for a living and he claims that the query string (?) bugs google in a bad way. – Rasmus Mar 09 '11 at 14:52
  • 1
    but there wont ba a query string ... ill clean up my answer – n00b Mar 09 '11 at 14:54
  • Im pretty new to php but from what i get, everything after the ? is supposed to be a query string or am i completly wrong on that one? – Rasmus Mar 09 '11 at 15:17
  • 1
    but it will not be visible to the user or search bot .... its completly server internal if you redirect it (correctly) from .htaccess – n00b Mar 09 '11 at 16:11
  • 1
    before you screw up / clean up your site please read the general URL rules i posted to this question http://stackoverflow.com/questions/3865020/is-it-good-idea-to-use-url-names-with-special-characters/3967220#3967220 ... manageable(!) is far more important than "making them short with a targeted keyword phrase" ... only mess with your URLs if you know exactly what you are doing. doing seo based on "i know a guy which knows a guy which says ..." is in general not a good idea – Franz Enzenhofer Mar 10 '11 at 12:02