Custom post type as home page with custom url

EDIT Since, as you mentioned it in comments, it can have several values, maybe we could retrieve the city list and set corresponding rewrite rules like so? assuming $city_list is an array of cities foreach ($city_list as $city) { add_rewrite_rule(‘/^’. $city .’/destination/’. $city .’$/’,’index.php?p=idofyourhomepage’,’top’); } How about trying some rewrite rules. add_rewrite_rule(‘/^london/destination/london$/’,’index.php?p=idofyourhomepage’,’top’); Or add_rewrite_rule(‘/^london/destination/london$/’,’index.php?pagename=nameofyourhomepage’,’top’); Go … Read more

How to redirect specific URL to Subdomain

To redirect example.com/pagecategory/page-single to pagecategory.example.com/page-single, where pagecategory is entirely variable then you can do something like the following at the top of your .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteRule ^([a-z]+)/([\w-]+) https://$1.%{HTTP_HOST}/$2 [R,L] I’ve limited the “subdomain” (ie. pagecategory) to just the lowercase characters a-z – this is saved in the $1 backreference. … Read more