Jump to content

Recommended Posts

Hi, my server is not exactly running apache (it's running lighttp to be exact..)

 

My host (a friend ;D) does not want to have the server scan every directory for an .htaccess because that would decrease preformance so he is only letting me have one in my main directory (/home/cory/htdocs/)

 

 

Now the problem is that I have a folder "/home/cory/htdocs/sigs" and I need a .htaccess to work for that folder...

 

 

<FilesMatch "^.*.png">
    SetHandler application/x-httpd-php
</FilesMatch>

 

How can I make it so that rule only works for /sigs/?

 

 

 

 

Another question!

 

How can I make it so if the person goes to like /sigs/MyUsername.png, have it get the info from something like 'info.php?name=MyUsername' but keep the file in the browser to stay at /MyUsername.png?

Link to comment
https://forums.phpfreaks.com/topic/150258-need-htaccess-help/
Share on other sites

You could maybe put a <Directory> statement in the .htaccess file.  Not sure if that's possible though.

 

 

As for the info.php?name=blah.....  First off, it's pointless to set the handler if you're going to do that.

 

Secondly, you would do that with mod rewrite.

Link to comment
https://forums.phpfreaks.com/topic/150258-need-htaccess-help/#findComment-789075
Share on other sites

As for the info.php?name=blah.....  First off, it's pointless to set the handler if you're going to do that.

 

Secondly, you would do that with mod rewrite.

 

Well I want it so people can put like http://MySite.com/sigs/TheirUsername.png in their signature and have it fetch the info for that username..

 

The only reason I am using TheirName.png is because most forum boards don't allow .php to link to images.

Link to comment
https://forums.phpfreaks.com/topic/150258-need-htaccess-help/#findComment-789082
Share on other sites

Yeah I know.

 

 

What I'm saying is, if you don't plan on the internal URL being PNG, you don't need to do a SetHandler.

 

 

As for the rewrite, it could be something as simple as:

 

RewriteEngine On

RewriteRule ^sigs/([a-z0-9_-]+).png$ /sigs/signature.php?user=$1

Link to comment
https://forums.phpfreaks.com/topic/150258-need-htaccess-help/#findComment-789090
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.