Search code examples
wordpress.htaccessmod-rewriteslug

WordPress single page rewrite rule / Adding custom page slug


I would like to change this page:

mysite.com/?ct_additional_features=hilltop&search-listings=true

to look like this:

mysite.com/test

Below is what I added to my htaccess: (above the WP main rewrite rules)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^test/(.*) index.php/?ct_additional_features=hilltop&search-listings=true [L]
</IfModule>

Solution

  • Use this in your .htaccess:

    RewriteEngine On
    RewriteRule ^test$ /?ct_additional_features=hilltop&search-listings=true [L]
    

    It will leave you with mysite.com/test