Hard to find a good rewriting rule

Rewrite rules are intended to convert ugly urls (containing with & and ?) into pretty urls not the countrary. So I think you need a redirect more than a rewrite rule: add_action(‘after_setup_theme’, ‘my_custom_redirect’, 1); function my_custom_redirect() { if ( filter_input(INPUT_GET, ‘post_type’, FILTER_SANITIZE_STRING) === ‘portfolio’ ) { $cat = filter_input( INPUT_GET, ‘portfolio-category’, FILTER_SANITIZE_STRING ); $tag = … Read more

Custom Structure permalinks error 404

Mehdi, it’s common problem, as Apache server is not set by this way by default. Your problem can be solved with some very simple steps (simply quoting Samuel B): If you want to use permalinks, you will need to make a change inside another file: apache > Conf and find the file httpd.conf. Open that … Read more

Rewrite rule shows 404 page

The index.php you see is not the template file. It is pointed to index.php file you see in the root of your WordPress installation. How does the pretty URL translate into a template file When a person goes to a URL on your site, the .htaccess redirects all requests, that don’t match an actual file, … Read more

Change /search to /somethingelse

Ok, the solution I’m now using is to create a rewrite rule in .htaccess (on the root of wp project) like this: RewriteCond %{QUERY_STRING} ^s=([^\&]*)$ RewriteRule ^(.*)$ /pesquisar/%1 [NE,L,R=301] I don’t know if it’s the best solution but seems to be working ok!

WordPress comment for virtual page

WordPress comments are segmented by IDs of their parent posts. For virtual pages you would either have to: replicate the process (by creating underlying Custom Post Type for it) or completely rebuild how it’s handled for them (for example by tracking segments as comment meta and query accordingly)

Taxonomy rewrite pagination 404

While looking for a solution I got this post: Taxonomies with same slug as CPT So basically you need to add custom rewrite rules, I haven’t tested the solution but I guess it will work out for you. /* Register CPT */ function wpse_138987_post_type_filter() { register_post_type(‘filter’, array( ‘labels’ => array( ‘name’ => ‘Filter’, ‘all_items’ => … Read more