//To modify the URL pattern (i.e., change the + in the URL to %20 for space) in PHP // Get the current request URI $requestUri = $_SERVER['REQUEST_URI']; // Check if the URL contains '+' and replace with '%20' if (strpos($requestUri, '+') !== false) { // Replace '+' with '%20' $modifiedUri = str_replace('+', '%20', $requestUri); // Redirect to the modified URI header("Location: $modifiedUri", true, 301); exit; }
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.