Rewrite Page Parameters

If city belongs to the page post type, then your rule should either be: add_rewrite_rule( ‘^city/([^/]*)/?’, ‘index.php?pagename=city&id=$matches[1]’, ‘top’ ); or: add_rewrite_rule( ‘^city/([^/]*)/?’, ‘index.php?page_id=5&id=$matches[1]’, ‘top’ ); Using p, the query will assume post type is post, not page. Also, if your code uses $_GET[‘id’] to fetch the value, this will no longer work with a rewrite … Read more

Allow direct access to files/folders within WordPress to replace wp-admin

Since you asked for recommended approaches… Why code your own custom dashboard? What is WordPress not doing that yours would? WordPress is 15 years old with contributions from hundreds of developers. Are you sure that your dashboard is going to be better, and worth your time (or your clients’ time) to code? I don’t mean … Read more

WordPress redirection

Yes.. that works out.. Yesterday I found that I needed to change again, the Permanent link.. I had to change it when I’ve copied the site on my local server..and I lost these “folder” link. I came back with ” Post name” settings ( as it was before )… and that works out I am … Read more

Redirect ignore last URL segment

I was able to get it working by adding the following two lines to my .htaccess, right before the rest of the other WordPress rule RewriteCond %{REQUEST_URI} ^/map/(.+)$ [NC] RewriteRule ^(.*)$ /map [L,P] Bottom of my .htaccess with the rules looked like this: RewriteEngine On RewriteCond %{REQUEST_URI} ^/map/(.+)$ [NC] RewriteRule ^(.*)$ /map [L,P] RewriteRule .* … Read more