HaLo2FrEeEk Posted February 3, 2010 Share Posted February 3, 2010 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 More sharing options...
corbin Posted February 3, 2010 Share Posted February 3, 2010 Either rewrite it transparently and don't use a redirect (although if the original page will be accessible too, you will either need to have that redirected to the page that will appear in the URL bar) or use a 301 redirect. Link to comment https://forums.phpfreaks.com/topic/190840-what-redirect-code-should-i-use/#findComment-1006395 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 25, 2010 Author Share Posted February 25, 2010 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. Link to comment https://forums.phpfreaks.com/topic/190840-what-redirect-code-should-i-use/#findComment-1017903 Share on other sites More sharing options...
jl5501 Posted February 25, 2010 Share Posted February 25, 2010 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 Link to comment https://forums.phpfreaks.com/topic/190840-what-redirect-code-should-i-use/#findComment-1017943 Share on other sites More sharing options...
HaLo2FrEeEk Posted February 26, 2010 Author Share Posted February 26, 2010 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. Link to comment https://forums.phpfreaks.com/topic/190840-what-redirect-code-should-i-use/#findComment-1018734 Share on other sites More sharing options...
jl5501 Posted February 26, 2010 Share Posted February 26, 2010 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 Link to comment https://forums.phpfreaks.com/topic/190840-what-redirect-code-should-i-use/#findComment-1018743 Share on other sites More sharing options...
HaLo2FrEeEk Posted March 4, 2010 Author Share Posted March 4, 2010 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. Link to comment https://forums.phpfreaks.com/topic/190840-what-redirect-code-should-i-use/#findComment-1021339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.