I have many thousands of profile URLs that currently look like this:
view_profile.php?id=12345
Is there any SEO benefit for me to change them to something like:
member12345.htm
I can make the change in my .htaccess file but I'm curious if it's even needed?
The easy solution edit your .htaccess file:
RewriteEngine On
RewriteBase /
RewriteRule ^member([0-9]+)\.htm(l)?$ view_profile.php?id=$1 [L,NC]
#or /member-1234.html
RewriteRule ^member\-([0-9]+)\-([^/])\.htm(l)?$ view_profile.php?id=$1 [L,NC]
#or /member-1234-user-name/
RewriteRule ^member\-([0-9]+)\-([^/]+)/?$ view_profile.php?id=$1 [L,NC]
L
mean last rule, so if the regular expression is match, it will stop there.
NC
mean non case so capital letters like ABC are treated the same as lowercase like abc.
If you want these member pages to be found at Search Engines, it'd be good to do a change like this. But only moving the number around would help little , but not much.
To really get an effect, you need to put meaningful words in the URL, e.g. member-12345-max-weller.htm
for my profile ;-)
This is because Google & Co. supposedly like static pages better than dynamic pages.
Yes, query urls are not optimal for SEO.
But instead of .htaccess you should use a proper php url mapper.
Take a look at Silex, url mapping is one of its core features. Eg:
require_once __DIR__.'/silex.phar';
$app = new Silex\Application();
$app->get('/hello/{name}', function($name) use($app) {
return 'Hello '.$app->escape($name);
});
$app->run();
Yes there is requirement of static page url that is more effective for robots to understand the pages content. with url you have to also managed the title and description of page. rewrite the url with .htaccess file best better option.