Loading...
 

ScriptEnableHtaccess

This script is not really useful any more.

Tiki ships with .htaccess in all directories except the root. In root, the file is _htaccess and you just need to rename it to .htaccess to use it. (it is not .htaccess by default because it could overwrite an existing .htaccess by accident) This is useful mostly for Clean URLs but also for Performance and Security.



If you need a script to enable/disable .htaccess files, try this one.

Save it as htaccess.sh into your tiki home, chmod u+x it, and run it from inside your tiki home:

./htaccess.sh enables .htaccess files
./htaccess.sh off disables .htaccess files

Copy to clipboard
#!/bin/bash # 2006 by ohertel for tikiwiki.org # enable/disable .htaccess files # default is: enable .htaccess files # $0 off disable .htaccess files OLD=_htaccess NEW=.htaccess ACTION=activating if [ "$1" = "off" ]; then OLD=.htaccess NEW=_htaccess ACTION=deactivating fi ENTRIES=`/bin/ls -Rd *` for ENTRY in ${ENTRIES} do # only work on directories: if [ -d "$ENTRY" ]; then # do nothing if $NEW already available if [ ! -e ${ENTRY}/${NEW} ]; then # if $OLD available, rename it if [ -e ${ENTRY}/${OLD} ]; then echo "${ACTION} ${ENTRY}/.htaccess" chmod 644 ${ENTRY}/${OLD} mv ${ENTRY}/${OLD} ${ENTRY}/${NEW} fi fi fi done
Created by: Last Modification: Tuesday 28 June 2011 21:13:54 GMT-0000 by Marc Laporte
List Slides