1

I'm currently creating a "dynamic signature" for a forum or email signature.

The php code writes perfectly fine onto an image with the .php page.

When trying to access the .png file with the userid, it doesn't show. I have a feeling it is the .htaccess file.

How its supposed to look: https://v.example.com/sig.php?user_id=1 enter image description here

How it looks: https://v.example.com/sig.png?user_id=1 enter image description here

what is in the htaccess:

RewriteEngine On
RewriteBase /
RewriteRule sig.png sig.php

UPDATE: I figured out i didn't have mod rewrite on in my AWS EC2 Instance. I just enabled it, and it still isn't working. :/

sudo a2enmod rewrite

UPDATE #2: Fixed. Was using bitnami wordpress and apache2, confusing apache setup had to give permission for apache2 to override.

closed as unclear what you're asking by Steve, dan Apr 11 '18 at 2:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Does the sig.png file exist? – MrWhite Apr 11 '18 at 0:15
  • 2
    Yes. both files exist. – abphaiboon Apr 11 '18 at 1:39
  • When trying to access the .png file with the userid, it doesn't show <- What does that mean, why would you being accessing a .png file with a user ID as a parameter? Does the image show without the parameter? You'll need to clarify this a bit for users to be able to understand what your PHP code does and what you're trying to accomplish with this rewrite. Also note that Apache or your instance needs to be restarted when you enable modules. – dan Apr 11 '18 at 2:49
  • @dan I created a php script that pulls database information and prints it onto the png image. Thats why it is pulling a user ID. I need it to be able to be a .png url so I can use this as a signature in emails or forums. – abphaiboon Apr 11 '18 at 2:53
  • 1
    Your problem would seem to be that mod_rewrite and/or .htaccess is still not enabled. (The mod_rewrite directives themselves are "OK".) Since you have a physical file called sig.png, the behaviour you are seeing is consistent with this. You are simply requesting and being served sig.png as if your .htaccess file didn't exist. – MrWhite Apr 11 '18 at 9:09