Htaccess File

legege/phpwt/master/example/.htaccess

DOCUMENT_ROOT, REQUEST_FILENAME
#
# PHPWT - PHP Website Toolkit
# You need to configure this file. Be sure to understand what each line does.
#

RewriteEngine On

#
# Specify the base URL path
#
#RewriteBase /
RewriteBase /~legege/phpwt/example

#
# If it's a real file or a real directory, we stop rewriting.
#
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*) - [NS,L]

#
# If the requested file exist in the content/ directory, rewrite.
# Configure the second RewriteCond with the absolute path to the content/
# directory. Normally you can use the %{DOCUMENT_ROOT} variable to help you.
#
RewriteCond $1 !^content/
# RewriteCond %{DOCUMENT_ROOT}/content/$1 -f
RewriteCond /Users/legege/Sites/phpwt/example/content/$1 -f
RewriteRule ^(.*) content/$1 [NS,L]

#
# Now rewrite all other URL to the index.php file.
# Be sure to list all languages of your web sites (en|fr|..)
#
RewriteRule ^(content/)?(en|fr)$ index.php?language=$3&uri=/ [NS,QSA,L]
RewriteRule ^(content/)?((en|fr)/)?(.*)$ index.php?language=$3&uri=/$4 [NS,QSA,L]

#
# Define common HTTP errors (required, it solves a bug with password
# protected directory).
#
ErrorDocument 400 /error/400
ErrorDocument 401 /error/401
ErrorDocument 403 /error/403
ErrorDocument 404 /error/404
ErrorDocument 500 /error/500
Exit mobile version