Jump to content

What redirect code should I use?


HaLo2FrEeEk

Recommended Posts

I recently redid my site to better support rewritten URLs to give Google and other search engines an easier time indexing.  I'm trying to decide which redirect code I should use so that the search engine (I'm mainly focusing on Google) will see the rewritten "static" url and index it, but it still knows that it's a redirect to another post.  For example, I make news posts on my frontpage that are associated with a certain LinkID, that LinkID is associated with a URL for, say, a post on the forum.  When someone clicks the redirect link on the frontpage they're taken to the full post.  I do it this way so I can track clicks to each specific link and display it.  A rewritten redirect URL looks like this:

 

http://infectionist.com/news[LinkID]/[news title].php

 

The news title is, obviously, the title of the news post, but it doesn't have to be there.

 

So any suggestions as to which redirect HTTP code I should use?

Link to comment
https://forums.phpfreaks.com/topic/190840-what-redirect-code-should-i-use/
Share on other sites

  • 3 weeks later...

By original page, do you mean this:

 

http://infectionist.com/news[LinkID]/[news title].php

 

If so then no, that page isn't accessible, it doesn't even exist, it's simply a rewrite of the click counter redirect, the URL for which is this:

 

http://infectionist.com/pages/clicky/clicky.php?id=[LinkID]

 

I haven't had any problems with my current mod rewrite, so I don't think I'll change anything.  I just want google to see that .php link and index the url with the news title.

Personally, I would have the false page that appears in the url, to end in .html

 

I am not sure if that makes any difference from a SEO point of view, but it does make the page to appear to be a static page and conceals what server side scripting you are using. obviously in can end in anything you like, providing your rewrite rules are looking for the correct ending

It doesn't affect the SEO in any way to have a .php ending as opposed to a .html ending, I know that.  I also have no reason to hide the scripting language I'm using, I make it pretty obvious to anyone that reads the site.  Also, the .php ending does denote a static URL, it doesn't have an parameters and the URL never changes.

The .html ending 'appears' to be a static file but need not be. it can handle any parameters you like as they get passed on to the actual .php file, but of course the idea of a SEO url is not to have parameters on the end, but to decode them from the text of the url

I'm mainly concerned with Google results, I don't really care about Yahoo.  Google does really well with parameters on URLs, but all the same I would like to help it out as much as possible.  Like I said it doesn't make a difference what your extension is, as long as there are no parameters.  .php, .html, it doesn't matter.  None of the URLs I'm using have parameters, so Google sees it as a static URL.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.