@gilbert
You can redirect a URL with a percentage (%) symbol by encoding the URL before setting up the redirection. Here's how you can do it using a few different methods:
1 2 3 4 5 |
<?php $url = 'http://www.example.com/page%20with%20percentage%20symbol'; $encoded_url = urlencode($url); header("Location: $encoded_url"); ?> |
1 2 3 4 5 6 7 8 9 10 11 12 |
<!DOCTYPE html> <html> <head> <script> var url = 'http://www.example.com/page%20with%20percentage%20symbol'; var encodedUrl = encodeURIComponent(url); window.location.href = encodedUrl; </script> </head> <body> </body> </html> |
Create or edit the .htaccess file in the root directory of your website and add the following line:
1
|
Redirect /page%20with%20percentage%20symbol http://www.example.com/new-page |
Replace /page%20with%20percentage%20symbol
with the encoded URL path and http://www.example.com/new-page
with the new URL you want to redirect to.
After performing one of these methods, the URL with the percentage (%) symbol should now redirect to the new URL successfully.