Hello everyone, Here is a quite important and really hard to answer question. I know that google crawlers ignore long links, that is links with question marks in them and parameters after that. I have read a lot about how in order to get the pages on a website indexed only links with pure HTML URL should be used such as www .example.com/page.php When I want to dynamically build links with php that are intended to pass variables from one page to another there seems no other way but to use question marks and long links. Most of the time there are plenty of links pointing to the same page with only a single parameter in the url that determines a particular item to be displayed on the page. This is not only clumsy but also highly disliked by search engine crawlers. For example in a link such as <a href="www.example.com?par=1&par=2&par=3">link</a> how do you get rid of all the parameters after the question mark and still pass them to the page? What do you believe is the best practice to tackle this issue in php?
Hi! Use hidden fields for passing values. Example: Page1.php <form action="Page2.php"> <input type="hidden" name="par1" value="1" /> <input type="hidden" name="par2" value="2" /> <input type="hidden" name="par3" value="3" /> <input type="submit" value="submit'> </form> Page2.php <?php print $_REQUEST["par1"] . "<br />"; print $_REQUEST["par2"] . "<br />"; print $_REQUEST["par3"]; ?>
yes, I was thinking about this, but the I want to pass the variable by clicking on a link. Is it practical and professional on a page with about fifty links to have 50 forms and what's worse 50 <input type="submit" value="submit'> buttons?
Would you elaborate on this a little bit? As far as I know htaccess is the directory-level configuration file. How can it help me to pass variables through links?
It is most definitely not true that search engines "ignore" query strings (string after quotation mark in URL), but they may have problems with duplicate content if you have URLs like /?action=videos, /?action=videos&sort=views and /?action=videos&sort=views&page=3. If that's the case, the answer to your question is canonical
Using mod_rewrite rules in htaccess file will solve your issue. You can refer this link if you need more details.
you can alternatively use javascript to execute the form on clicking the link. that way the javascript submits the form, and the form post settings are then set and the form post url would be that of the page you want to end up. http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
To folks suggesting URL rewrites or form submission: - URL rewrites don't solve this problem if you need to get all those parameters passed via URL; that would only make those URLs more "search engine friendly", which is't all that helpful, contrary to popular belief. Besides, not all applications are suitable for URL rewriting. - JavaScript/hidden form submission hides parameters (since search engines mostly don't follow forms) and is almost like cloaking. That would also make same URLs display different content based on hidden POST parameters, which is also very bad. I strongly suggest that you read the blog article from my previous post. Don't trust that "search engines hate query strings" crap, there are too many "SEO experts" around here.