Score:0

Apache RewriteRule losing one slash of the https://

de flag

On my apache server, I need to pass full URLs as parameters to a php function. However, when I use something like:

RewriteRule ^(.*)$ ../image.php?url=$1

$1 ends up losing one of the slashes of the https. So, in other words, if I try using it to parse https://example.com/img01.jpg, $1 is only receiving https:/example.com/img01.jpg

kz flag
Where exactly are you using this rule? What other directives do you have? `$1` shouldn't contain the scheme + hostname anyway, the `RewriteRule` directive matches the URL-path only.
de flag
I have a php script that caches images. normally, you would access it as example.com/image.php?url=https://anothersite.com/img01.jpg , but I want the users to be able to reach it instead by going to example.com/image/https://anothersite.com/img01.jpg
kz flag
And... where exactly are you using this rule? (Server config? vHost? `<Directory>` container? `.htaccess`? Where is the `.htaccess` file located? Do you have any other `.htaccess` files?) What other directives/rules do you have? There are some errors with the rule you've posted, however, for you to get the result you are seeing you would also seem to have a conflict with existing directives.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.