Take the 2-minute tour ×

Possible Duplicate:
using apache’s mod_rewrite to parse SEO friendly URL’s

I am building a site and I am using MVC concepts to dynamically load content. Basically I have a single file, index.php, and distribute the request to the appropriate controller.

So the url "siteurl.com/post would redirect to siteurl.com/index.php?ctrl=post and then the post controller would load the appropriate page.

My question is, is this going to be bad for SEO since I route everything through one page? Is there a better way to do this?

share|improve this question
This is probably a dupe of about 2/3 of the questions over on the Related sidebar. –  Charles Dec 15 '12 at 23:04
add comment

marked as duplicate by tereško, Jocelyn, DaveRandom, PeeHaa, cryptic ツ Jan 6 '13 at 16:54


2 Answers

up vote 1 down vote accepted

No, it is not bad. You're rewriting, not redirecting. The client (crawlers included) has no idea what is going on server-side, and doesn't care. Clients think they are on the URL they are on your friendly URL.

I recommend using a tool, such as Fiddler or Wireshark, to look at the raw HTTP traffic to fully understand what is going on.

share|improve this answer
Ok thanks. So it just sees it as a bunch of separate sites –  user1846761 Dec 15 '12 at 23:05
@user1846761, It sees a bunch of different URLs. Whether they are "different sites" or not depends on your page's content. Search engines aren't too fond of sites that have 100 pages with identical content. Be sure to serve identical content only from one URL, and use canonical URLs when this isn't reasonable. –  Brad Dec 15 '12 at 23:06
@user1846761 - MVC's are (always?) inward funnels. Your users see nifty urls like http://home.com/decor/living/lamps/modern/, whereas your server software (not PHP) intercepts the requested URL (see that one I just gave you?) as it comes into the system and rewrites the path so it acts like http://home.com/storefront.php/decor/living/lamps/modern/, which then PHP gets a ahold of and goes to work. It's going on inside. And for SEO, having meta keywords in the URL is good. –  Jared Farrish Dec 15 '12 at 23:14
What's with the downvote? If you're going to downvote an answer, leave an explanation for everyone's benefit. –  Brad Dec 15 '12 at 23:20
add comment

No, in fact is the way most frameworks do their job. The pattern you are using is called Front controller pattern and does exactly that so don't worry about your SEO. If you want prettier URL's you can always use Apache's mod_rewrite.


share|improve this answer
Same here, why the downvote? I've just added some info about the pattern –  LuisClemente Dec 15 '12 at 23:48
add comment
