Custom rewrite rule

Add the following to your .htaccess, in between the <IfModule mod_rewrite.c>: RewriteCond %{QUERY_STRING} (^|&)filter=all&search_text=&type=(.*)&location=(.*)&cs_directory_search_location=Yes&search_view=&goe_location_enable=No&cs_loc_max_input=5&cs_loc_incr_step=1&submit=&action=cs_directory_map_search RewriteRule ^(.*)$ /directorio/%2/%3/? [R=301,L] You can confirm the logic through this .htaccess tester. Your default .htaccess created from WordPress should now look like the following: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f … Read more

How to create an endpoint without creating sub endpoints?

The rewrite rule added by: add_rewrite_endpoint( ‘my-endpoint’, EP_AUTHORS ); is author/([^/]+)/my-endpoint(/(.*))?/?$ => index.php?author_name=$matches[1]&my-endpoint=$matches[3] so it assumes anything after e.g. /author/henrywright/my-endpoint/…. You can try instead to replace it with add_rewrite_rule() e.g. add_rewrite_rule( ‘^author/([^/]+)/my-endpoint/?$’, ‘index.php?author_name=$matches[1]&my-endpoint=1’, ‘top’ );

Using Blog Parent Slug on Blog Posts Only

Just set your custom permalink structure to: /theblog/%postname%/ If you have any custom post types used on your site, you’ll need to make sure that they don’t get the /theblog/ prepended to their URLs. To remove it, simply set with_front to false where the custom post types are registered: ‘rewrite’ => array(‘slug’ => ‘portfolio’, ‘with_front’ … Read more

How to perform a query at the URL?

The reason behind this is how the URL rewriting works. No matter what is the setting of your permalink structure, all the requests will be redirected to index.php. So, for example: example.com/category/travel will eventually turn into: example.com/index.php?cat=travel So in your example: example.com/category/travel/?year=2007 will be turned into: example.com/index.php?cat=travel&year=2007 and possibly because the last argument overrides the … Read more

Adding more pages to author pages

The author rewrite rules are filtered through author_rewrite_rules. You can add a rule there for the pattern author/([^/]+)/edit/?$, but the substitution will depend on how you want to create the edit page. A simple example that will set a custom query variable and load a specific template if this variable is set: add_action( ‘author_rewrite_rules’, ‘wpse18547_author_rewrite_rules’ … Read more

Issue with using .htaccess to redirect feedburner feed

Try this. This format works for me. You don’t have to keep repeating IfModule, RewriteEngine, RewriteBase. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteCond %{HTTP_USER_AGENT} !^.*(FeedBurner|FeedValidator) [NC] RewriteRule ^feed/?.*$ http://feeds.feedburner.com/mysite [L,NC,R=302] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] RewriteRule ^download/([^/]+)$ http://www.mysite.com/blog/wp-content/plugins/download-monitor/download.php?id=$1 [L] </IfModule> # END WordPress … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)