One good search engine optimization(SEO) technique states:
To ensure a better spidering of web pages web sites should use static(.html) files instead of dynamic(.aspx, jspx or php) ones.Many people have converted their dynamic web sites using .htaccess file and in particular mod_rewrite module in Apache. Thus the webserver represents to the client a dynamic page with its parameters as a static one.
Example: http://www.website.com/index.php?mode=look_article&article_id=421
becomes
http://www.website.com/article-421.html
Results are that the search engines will have no trouble accessing/spidering the whole website content and the Url becomes friendlier to the users.
However your website may not work the same as before. So here are some advices on using of Forms that will keep you away from future trouble:
If you are using web forms it is easier and more secure to write them:
form method="post" action="?mode=list_comments"instead of
form method="post" action="index.php?mode=list_comments"These examples both work fine but let's see what happens when our urls gets rewritten by .htaccess file rules.
For example our aim is to post a comment. We have 2 cases:
1. Good: If we are on the home page or "index.php".
Then all of our forms will work because inside the form action="?mode=post_comment" will be translated by .htaccess to action="index.php?mode=post_comment" and then from the internal website engine to action="post_comment.php" that will actually post the comment.
2. Bad: When we are on different than index.php page.
For example let's suppose that we are looking an article. Our url inside the form action attribute will be:
form action="article-421.html?mode=post_comment"this gets translated to:
form action="index.php?mode=look_article&article_id=421&mode=post_comment"Translated by our server the first part ?mode=look_article will execute but the second mode=post_comment will not. So our form will not run and the server will give us again the article.
The solution:
In order your forms to be accessible and run from everywhere: use full form Urls as action attributes
Example:
form action="index.php?mode=post_comment"Hope it will help you!

0 коментара:
Post a Comment