Tag Info

New answers tagged

1

You need to flush rewrite rules after adding or modifying rewrite rules in WordPress. flush_rewrite_rules() can be used to flush rules. For more info check these links : https://codex.wordpress.org/Rewrite_API/add_rewrite_rule https://codex.wordpress.org/Function_Reference/flush_rewrite_rules


0

I had the same issue and found a solution. From what I learned so far, there might be two causes to this problem: WP doesn't recognize your rewrite rules because they are not cached yet. You can check this by dumping get_option( 'rewrite_rules' ); and if your rules did get cached, then they'll be in that option. To ensure your rewrite rules are cached, ...


1

All rewrite rules should point to index.php. This is a reference to the main index.php file through which all requests are routed, not a template file.


1

1.Login as the admin in WordPress. 2.Go to the Settings tab. 3.Go to the Reading tab. 4.Change the Blog pages show at most from the default 10 to any number *less than 10. For example, 5. 5.Save the changes. 6.View the blog. Hope that helps.


1

I think you can create a rewrite rule for each "region" to don't overwrite other important rules you could need (like pages, categories, etc..). I was playing with your code examples and with a small change in rewrite_resets could work: public function rewrite_resets() { global $wp_rewrite; foreach($this->ENABLED_POST_TYPES as $post_type) { ...


0

I finally figured out how to fix the issue I had. I added the following into my rewrite_rules function: add_rewrite_rule('^mysearch/location/([^/]+)/page/([0-9]{1,})/?$','index.php?page_id=200&location=$matches[1]&paged=$matches[2]','top'); So now my URLs are exactly as I wanted them: /mysearch/location/SUBMITTED-INFO/page/WHATEVER


0

If anyone is wondering I figured it out. Since I was hosting my WordPress site on a Chassis server, the path I needed to use in my require statement was different than the actual path on my machine.


3

Edit your existing code to exclude the index.php from redirecting like this: RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} !^/info/ RewriteCond %{REQUEST_URI} !^/index\.php$ RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L] For an explanation, check the answer to this question at Stackoverflow: Issue with .htaccess redirecting all ...


0

The simplest way to handle this is to create a page with slug property which will be used to display all properties, and add a rewrite rule to handle requests for property IDs. // add property_id query var to hold ID of requested property function wpd_query_var( $query_vars ){ $query_vars[] = 'property_id'; return $query_vars; } add_filter( ...



Top 50 recent answers are included