Timeline for URL Rewriting for PHP script on an image URL
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 4, 2020 at 10:16 | comment | added | w.jelsma | Project was on hold for a while, working on it again now though. I got it working locally though I cannot find a way to make it work on the server. We use the same .htaccess files for other projects as well so if there is a possibility to do this without editting the .htacces and do it within the code that would be the perfect sollution for me. | |
Aug 28, 2020 at 23:53 | comment | added | MrWhite | How did you get on with this? | |
Aug 11, 2020 at 13:33 | comment | added | MrWhite |
You can specify a root-relative URL-path (or file-path) - less the slash prefix (optional) - as the 2nd argument to the RewriteRule directive. eg. If the target file is https://www.example.com/wp-content/themes/THEME/randomImage.php then specify wp-content/themes/THEME/randomImage.php in the RewriteRule directive. (However, this can depend on what other directives you have in your .htaccess file.)
|
|
Aug 11, 2020 at 13:24 | comment | added | w.jelsma | And how does routing work with the RewriteRule? I mean how do I specify the location of my randomizer.php file? | |
Aug 11, 2020 at 12:28 | comment | added | MrWhite |
"there must be a file like image.jpg?" - absolutely not. In fact, if image.jpg did exist then it will not be accessible since all requests are sent to randomizer.php instead.
|
|
Aug 11, 2020 at 11:58 | comment | added | w.jelsma | Does this mean that there must be a file like image.jpg? Or does it work without its existance | |
Aug 11, 2020 at 11:42 | history | edited | MrWhite | CC BY-SA 4.0 |
Added link to similar question on StackOverflow
|
Aug 11, 2020 at 11:36 | history | edited | MrWhite | CC BY-SA 4.0 |
Added link to similar question on StackOverflow
|
Aug 11, 2020 at 11:12 | history | answered | MrWhite | CC BY-SA 4.0 |