Options +FollowSymLinks
RewriteEngine On

# On some servers the url rewrite didn't work; in that case try uncommenting this line and write your path there, e.g /gallery
# RewriteBase /gallery

RewriteRule ^admin(/)?$ admin.php [QSA]
RewriteRule ^admin-categories(/)?$ admin_categories.php [QSA]
RewriteRule ^admin-category-edit(/)?$ admin_category_edit.php [QSA]
RewriteRule ^admin-regenerate-thumbnails(/)?$ admin_regenerate_thumbnails.php [QSA]

RewriteRule ^login(/)?$ login.php [QSA]
RewriteRule ^logout(/)?$ logout.php [QSA]
RewriteRule ^upload(/)?$ upload.php [QSA]


# rewrite the URL of photos, to avoid the /files path in URL
RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9-_]+).jpg$ files/$1/$2.jpg [QSA]


# not used for now
# RewriteRule ^([A-Za-z0-9-_]+)/([A-Za-z0-9-_]+)(/)?$ photo.php?cat_url_string=$1&photo_url_string=$2 [QSA]

RewriteRule ^([A-Za-z0-9-_]+)/edit-photos(/)?$ admin_edit_photos.php?cat_url_string=$1 [QSA]

RewriteRule ^([A-Za-z0-9-_]+)(/)?$ category.php?cat_url_string=$1 [QSA]

