Learn WordPress
Home » Programming

Changing The Default WordPress Permalink Search for More SEO Friendly

Changing The Default WordPress Permalink Search

Replace the default search property permalink wordpress for more SEO Friendly. Why this should also be noted? Struggled in the Internet business or online business must have been very concerned about the factors that can be small or big boost visitor traffic. :o

Ideally what you will do is how to change the permalink structure search default wordpress property which “less SEO friendly” becoming more apparent better in the Search Engine. The default search wordpress permalink structure looks like:

http://www.YourDomain.com/?s=internet+business

and you should change to

http://www.YourDomain.com/search/internet+business

Permalink structure to the second search better views and more “SEO Friendly”. And you will learn how to create a permalink structure like this search. In sum is to replace the string of ?S= to search. This can be done in two ways:

  1. Using .htaccess file.
    The first way you can use .htaccess file, with Apache RewriteRule method, please see the documentation here. Open .htaccess file via file manager of your hosting and then add the following code:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{THE_REQUEST} ^[A-Z]+\ /(#[^?&\ ]*)?\?([^&\ ]*&)?s=([^&\ ]+)[^\ ]*\ HTTP/
    RewriteRule ^$ http://www.YourDomain.com/search/%3? [R=301,L]

  2. file search.php

    komunis

    You can add the following code and save it at the top of the file search.php

    <?php
    if($_GET[‘s’]!=”){
    $urlredirect = get_settings(‘home’) . ‘/search/’ . str_replace(‘ ‘, ‘+’ ,$_GET[‘s’]) . ”;
    header(“HTTP/1.1 301 Moved Permanently”);
    header( “Location: $urlredirect” ) ;
    }
    ?>

FREE Cloud Storage