and actually i am converting the url using javascript
<script type="text/javascript"> $(document).ready(function() { $('.search-form').submit(function() { var value = $('.search-form input:text').val(); value = value = value.replace(/\W/,''); // replace window.location.href = value + "-keyword" + ".html"; return false; }); }); </script>
Is there a way to convert seo-friendly url without javascript? perhaps with php?
I use the following technique because
:
<?php //receiving page if(isset($_GET['name_of_submit'], $_GET['search_phrase'])) { header("Location: /address_to_this_script/".$_GET['search_phrase']); die; } if(isset($_GET['search_phrase'])) { // handle search and validation here, don't forget to escape it! }
, , , - URL-, URL- SEO . onclick, URL- SEO javascript, Google .
, , - db, " " ( seo), , .
- , .
Source: https://habr.com/ru/post/1735153/More articles:When does this happen? Thread suspended in critical section - language-agnosticHow do I know if tasks have been completed / performed? - Krontab - pythonOptimization of sending notification algorithm in C #? - c #Curl Release Report - phpGoogle AJAX CDN Libraries for jQuery - jqueryProblem with DisplayPattern in SharePoint 2010? - sharepoint-2010HTML cache content by storing internal javascript variable in external js file? - javascriptjqGrid - as hidden fields in edit form - jqueryDisable JQGrid dropdown in edit dialog - javascriptTile-based MMORPG motion protocol - udpAll Articles