There is no “normal” way (either is commonplace), but it all comes down to your permalink structure, and whether that has a trailing slash or not.
As for your login page, it all depends on how you’re generating the URLs, but I would suggest using user_trailingslashit( $basepath_without_query )
.
As the name suggests, it will apply (or remove) trailing slashes to match the configured permalink structure.
Related Posts:
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- Static variable and add_rewrite_rule?
- How to add elements to an empty array in PHP?
- Where to get information about array fields in $_REQUEST?
- Pass a PHP variable to another file
- How can I modify the permalink via a filter?
- How to store the_title() into a variable to reutrn the value, not just echo it
- Variables declared in header not available in other includes
- How do I make my function add variables/values to the $post object?
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- where to include a php file
- How do I know what variables are passed in a filter/action and what their meaning is?
- Newbie question: no index.php? in my plain wordpress permalink
- Change links automatically to affiliate links
- Rewrite sub folder dynamically with country code in WordPress using PHP
- When would you use $_post instead of $post?
- Use WordPress’ URL rewrite engine
- Locating Global Variables
- Pass PHP variable to JavaScript without inline JS
- Count the number of times the search form template gets included on a page
- Rename “Portfolio” slug?
- Putting PHP variables into javascript [duplicate]
- Variable global scope [closed]
- Using a variable in is_page(array())
- Nesting if statements to echo only one string based on what tag was filtered?
- How to put a variable in a instance in the widget
- Call global variable array() in woocommerce child/template
- get_term_link() returns correct – But illogical error-messages disturb
- How to change home or site url using action hooks or filter?
- Why do WordPress rewriites seem to work differently for posts vs pages?
- Performance impact of rewriting WordPress URLs
- How can I Add a variable PHP in the Menu Nav
- Is sanitize_title_with_dashes formatting function too liberal (in terms of accepted characters)?
- Pass variable from one function to another
- Get value from shortcode to do something
- Changes in permalink structure in WordPress and how to apply to in-site links
- WordPress Persistent connection rule does not work for “posts”
- Append query string to all URL’s
- custom rewrite rule help! Custom rewrite rules not applying to custom post type
- subdirectory index.php is not working
- Use URL Rewrite as well as $_GET parameters in URL?
- How to modify URL (add GET values) after front end form submission?
- PHP, Creating a dynamic variable
- How to modify a global variable in a function and use it on another function?
- parts of url disappear when using # inside href=”” [closed]
- Create custom permalinks to show Custom Post Type’s relationship?
- Add .htm extention to a custom taxonomy
- Help with .htaccess and Login with Subfolders
- WordPress add_rewrite_rules for custom URLs ending in .html
- Variable not staying set
- WordPress function and string as variable?
- Create a WordPress shortcode using PHP [duplicate]
- How to pass a PHP $_GET variable and fetch/output it?
- Creating WordPress Shortcode with Variable
- How to put a form with php code into a variable or shortcode?
- Apply class to every third list item? [duplicate]
- persist a variable set in header.php all the way down to footer.php
- Get access to variable from previous pageview, excluding ajax-calls
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- How to deal with too many $_POST variable conditions from ajax request at backend? [closed]
- Divi change project category slug
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- How to pass a variable to get_template_part that’s updated every time the template part is called?
- Insert page content into another page with a changed variable
- Pass Variables or Variable Place-Holder from Editor to PHP
- How to access or parse key/values that have “string”
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- javascript variable to wordpress php variable
- How to add a rewrite endpoint to unattached media?
- How to reference PHP in Javascript
- How do i add slugs to a URL, but still redirecting to the same page
- Store and Change Session variable – PHP SESSION VARIABLE
- Overide Variable in Child Theme
- Nginx WordPress and another Web app URL structure
- Custom post type url Rewrite (conflicting with page url)
- echo var into wp_query
- how can I include some custom variable from functions.php?
- Dynamically adding filters
- WordPress Rewrite Rule
- PHP variables in a post?
- Why is home page content not displaying with this rewrite rule?
- Modifying WP URL handing code?
- How to deal with a GET variable of ‘name’?
- WordPress is removing query variables like page, p from the URL of a custom static page
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- How to pass username in affiliate link in wordpress website
- How to send a php var to jQuery Ajax call with two different file
- Unable to display multiple parameters from url by javascript through shortcodes
- Test the existence of a page/article by its URL, taking in consideration the URL rewriting by filters
- How to check a variable Changes
- url not using query string no longer working
- global $product is empty string when passed into function
- Can’t pass var from php wp_ajax into ajax script : result undefined or null
- Custom global variable not working in function
- WordPress How do I pass a variable from one add_action to another?
- Best way to use variables in multiple functions?
- Trying to add some custom text into WordPress Post title via function.php
- Current WordPress Page Title as Search Parameter into A Tag
- Reduce Stock Based on Custom Variation Field Rather than Attribute (Working Script)