I am running multiple sites on one server and am tired of seeing 404s coming from missing apple-touch-icons. I am required to have 6:
apple-touch-icon-57x57-precomposed.png
apple-touch-icon-72x72-precomposed.png
apple-touch-icon-114x114-precomposed.png
apple-touch-icon-144x144-precomposed.png
apple-touch-icon-precomposed.png
apple-touch-icon.png

Each "property" docroot I am hosting may, and probably will, have several sub-docroots all using the same apple touch icons as the parent so, this is what I want to do:

I have a common php file included in each apache configuration that knows the name of each property's name and sub-property's parent's names, which can be used in one single directory hosted on the server which will contain all of my apple-touch-icon images separated by directories named after the parent properties. In apache I can create an alias to this directory like so:

Alias /apple_touch_icons /var/www/common/apple_touch_icons/[enter property name here]/

But this won't be very dynamic so I want to move the directive into my common included php file and do the same thing, but with php instead. Is this possible?

Member Avatar for LastMitch

@R0bb0b

I have a common php file included in each apache configuration that knows the name of each property's name and sub-property's parent's names, which can be used in one single directory hosted on the server which will contain all of my apple-touch-icon images separated by directories named after the parent properties. In apache I can create an alias to this directory like so:

I got no idea what you are talking about? I know apple devices is written Objective-C. Can you provide a little more detail what is the issue plus some php code to at least start on. Right now, it's just guessing.

Is this local?

Read this:

http://www.mediawiki.org/wiki/Manual:Short_URL/Apache

Long story short, I want to know if there is a php equivilent to an apache alias and I'm affraid the answer is no.

The question you are asking is very rare that's why it hard understand or test out.

Read this if you have already have. I feel you did:

I agree, it is very rare. But it would be the perfect solution to a very rare problem that I have. Now that I think of it, I think this is turning into an apache question. I want to take the full path "/var/www/[property name]/site", extract the "[property name]" from that path and turn that into an apache alias like so:

Alias /apple_touch_icons /var/www/common/apple_touch_icons/[property name]/

I may need to go to the apache section and ask there.

EDIT: this would enable me to add this bit of apache configuration to all properties created by all developers, which would allow me to put these ipad/pod/phone icons all in one location rather than having these images all over the place. Hmm, there is no apache section, that's funny.

This works and does exactly what I need it to do

AliasMatch ^/apple-touch-icon(.*)\.png /var/www/lib/icons/iconHandler.php

Thanks for the help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.