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

Multisite installation on IIS gives 404 trying to access the admin dashboard

As per this issue on the WordPress trac, the problem are the rules 4 and 5. The solution is to change the url parameter and add 1, so, instead of this: <rule name=”WordPress Rule 4″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)” ignoreCase=”false” /> <action type=”Rewrite” url=”{R:1}” /> </rule> <rule name=”WordPress Rule 5″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?([_0-9a-zA-Z-]+/)?(.*\.php)$” ignoreCase=”false” /> <action … Read more

add_rewrite_rules prefix everything

Have you ever consider to use rewrire_rules_array filter to alter $rewrite_rules? /** * Example of Changing All Rewrite Rules * * @param array $rewrite_rules The compiled array of rewrite rules. * @return array The compiled array of rewrite rules (altered). */ function wpse_263624_rewrite_rules_example( $rewrite_rules ) { $prefixes = array( ‘otro’, ‘esto’ ); $prefix_regexp = ‘(‘ … Read more

RedirectMatch and Redirect interfering with each other

RedirectMatch and Redirect interfering with each other In the example you’ve given, RedirectMatch (mod_alias) and RewriteRule (mod_rewrite) are “interfering with each other”, not Redirect. Redirect is a mod_alias directive, that works with RedirectMatch – so you wouldn’t necessarily expect these to conflict in this way. As mentioned above, RewriteRule is a mod_rewrite directive, whereas RedirectMatch … Read more

Disabling post_type in URL

I think you might be able to accomplish this via filter. Looking at the core wp class you’ll find the $public_query_vars and $private_query_varsvariables defined by a hardcoded array. These could probably be overriden/changed via the global $wp object but if you dig a bit deeper there’s a filter that should let you remove items from … Read more

Multiple Permalinks for Same Post

The request parsing is handled in WP::parse_request(). After that, there’s a action hook parse_request which gives you the instance of the wp object. We assume that http://www.example.com/my-custom-post-type/this-is-a-cool-article is your permalink and http://www.example.com/mon-type-de-poste-personnalise/cest-un-article-sympa ends up in a 404. So the first thing to check in your callback should be, if the wp object is in a … Read more

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