Store
Community Documentation

v3 Knowledgebase

Rename Photo Names V3 Feature

This feature is for V3.3 and up.

Apache "mod_rewrite" will have to be enabled to use this feature.

If you want to rename a photo based on what the title of the photo or the title provided by the user when processing their recently uploaded photos, this tutorial will help you do that. By default we use a 32 character unique hash to protect images, however enabling this feature will still create a unique ID for each image and help with image SEO.

Go to:

AdminCP >> Settings >> Manage Settings >> Photo and find this setting:

Rename Photo Names set it to True

Be sure you have loaded the htaccess.txt file from the latest version of phpFox for this to work.

Rename the htaccess.txt file to .htaccess, removing and replacing your old one if you had one active already in your site root directory. (you need to enable "view hidden files" to see it)

Edit the file ".htaccess" find in your site root directory.

Look for the following in that file:

# Rename Photo Names

Under that line you will find 2 lines that have been commented out. Simply uncomment those 2 lines by removing the hash "#" symbol.

Original looks like this before the edit:
# Rename Photo Names
	# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)-(.*?)_([0-9]*?).(.*)$ file/pic/photo/$1/$2/$3_$5.$6
	# RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)-(.*?).(.*)$ file/pic/photo/$1/$2/$3.$5


And after the edit:
# Rename Photo Names
	RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)-(.*?)_([0-9]*?).(.*)$ file/pic/photo/$1/$2/$3_$5.$6
	RewriteRule ^file/pic/photo/([0-9]+)/([0-9]+)/([A-Za-z0-9]{32}+)-(.*?).(.*)$ file/pic/photo/$1/$2/$3.$5


It is important that you use the most current htaccess.txt file for this because there were changes made from previous versions for this to work.

When done editing, clear your site cache on the server:

file/cache you will empty the cache folder but leave the index.html in there.