How to disable URL rewriting for specific URLs?
In wp admin go to settings > permalinks and remove the trailing slash.
In wp admin go to settings > permalinks and remove the trailing slash.
Here’s the why part: This part of the redirect_canonical() is removing the leading & in the redirect query part: // tack on any additional query vars $redirect[‘query’] = preg_replace( ‘#^\??&*?#’, ”, $redirect[‘query’] ); Example: example.tld/?&a=1&b=2&c=3 is redirected to example.tld/?a=1&b=2&c=3 If you must have the leading & you might try to adjust it through the redirect_canonical … Read more
The code seems incomplete. Maybe the problem is simply that you define $id but then try to use $user_id? Also, I think id is a protected variable, so maybe use my_id instead. Try this: www.mysite.com/test?my_id=123 $user_id = $_REQUEST[‘my_id’]; $camp_link = get_site_url().”/campaign-detail/?id=”.$user_id; echo “<p class=”campaign_store_name”><a href=””.$camp_link.””>”.$camp_title.”</a></p>”; $arform_id = Get_ARFORM_ID_using_slug($camp_link);
You should hook add_rewrite_rule() into init Assuming http://local/rieltplus/ is your homepage, and category/catalog/ is a category archives, this should work: add_action(‘init’, function() { add_rewrite_rule( ‘category/catalog/([^/]+)?$’, ‘index.php?category_name=catalog&type=$matches[1]&price_min=1000&price_max=2000&area_min=5&area_max=50&room_num=5&etage=2&plan=old’, ‘top’ ); }); If you want to make that available to any category then mention it in the comments. By the way, local/rieltplus/category/catalog/TYPE&price_min is not a valid URL, unlike … Read more
Recommend and currently use Quick Page/Post Redirect Plugin https://wordpress.org/plugins/quick-pagepost-redirect-plugin/ Request URL Destination URL /page/ http://example.com/uploades/file.pdf
You can use the rewrite parameter to disable the front portion of the URLs (/academy/ in your case) for custom post types. function create_posttypes() { $labels1 = array( ‘name’ => __( ‘Definitions’ ), ‘singular_name’ => __( ‘Definition’ ), ‘all_items’ => __( ‘All Definitions’ ), ‘view_item’ => __( ‘View Definition’ ), ‘add_new_item’ => __( ‘Add New … Read more
In the context of that question, yes it is. Without inspecting the content type header you don’t know if what is being served is an html page or an image, and while it is unlikely that the regex will match anything in an image, the risk is there. a different way to write that code … Read more
Just customize the login URL with the login_url filter: https://gist.github.com/tripflex/ac477b59d20bd11c5856edcffc13e5ef add_filter( ‘login_url’, ‘smyles_custom_login_url’, 10, 3 ); /** * Filters the login URL. * * @since 2.8.0 * @since 4.2.0 The `$force_reauth` parameter was added. * * @param string $login_url The login URL. Not HTML-encoded. * @param string $redirect The path to redirect to on login, … Read more
how’s the URL structure? Could you paste here? If you’re URL follows this structure: http://example.com/?foo=bar, so you need to get the foo value with this: if ( isset( $_GET[‘foo’] ) ) { $bar_value = $_GET[‘foo’]; // Do whatever you want with $bar_value. } else { // Do something else. } If that doesn’t work, you … Read more
There really should be a simpler way to do it but you kind of need to know that WordPress stores both the Front Page ID and Blog Page ID in the options table. So, to get the URL of the blog you need to use both get_permalink() and get_option() in conjunction. <a href=”https://wordpress.stackexchange.com/questions/270158/<?php echo esc_url( … Read more