Originally Posted by leslie.jones
Normally (which is a bit of a generalisation as there is no such thing tbh).....
You would have some clear and defined structure, and be working the other way round, that is:
LINK: mysite.com/tutorials/1 --->REDIRECT ---> mysite.com/show.php?id=1
LINK: mysite.com/tutorials/2 --->REDIRECT ---> mysite.com/show.php?id=2
LINK: mysite.com/tutorials/3 --->REDIRECT --->mysite.com/show.php?id=3
With this, your rewrite code can grab the '/1, /2, /3' and use that data in the redirect response - so you would have one rule to deal with all cases, plus a safety trap that redirects any non-existent files/pages should some user request something like mysite.com/tutorials/9999999999.
But you are working back to front because you are trying to transcribe:
LINK: blog-article.php?id=14 --->REDIRECT ---> /blog-post/logo-in-5-minutes-photoshop-tutorial/1/
From a code perspective there is no structure for mod_rewrite to work with, and you have no choice but to use an individual rule for id=14 for it to redirect to: /blog-post/logo-in-5-minutes-photoshop-tutorial/1/. If you only have 8 links it is not the end of the world, just write 8 rules. It's not optimal, but it should work without obvious issue.
MOD_REWRITE is not always the answer. Sometimes it is better to have a scripted handler that grabs the querystring, looks it up in a local array, table or database, and redirects based upon that. In your case, where your links are already making use of a querystring it may be a better option to put a simple php redirector together.
As for page ranking et al, it is not an area I can honestly say I am confident to give good advice in. I think in terms of logic, mostly, but this may be flawed and not match the metric used by search engines.
Once you arrive at the target page (by redirection or directly) your links on that page should be fixed to point directly to the correct place and need no redirection, surely?
I had an old website that was really outdated.
There was no seo within the pages, the urls were all variables etc and not pretty.
So i completely re built the website.
Now the website has a different structure and completely different urls.
For instance my old contact page was say-hello.php
The new one is now, /contact-us/
The reason for the 301 is so that all old pages point to the same content which has now moved in url.
Ive spoken to people on seoforum.ord and seomoz.com and they have all stated that a 301 is a must if i want to keep page authority and rank for each and every page, plus all links from external websites still point to a relevent page.
That is why this is needed.
The query code which was given above made it so it added the id=14 on the end of the redirect which is causing a problem, which means the query can only be input once because on the next one it shows a page 404 instead.