Forum Moderators: phranque
Options +FollowSymLinks -Indexes -MultiViews
Options +FollowSymLinks -Indexes -MultiViews
RewriteEngine on
RewriteCond $1 !^profiles
RewriteRule ^([a-z0-9_-]+)$ /profiles/$1/ [L] [edited by: jdMorgan at 3:26 pm (utc) on Feb 25, 2010]
[edit reason] example.com [/edit]
Options +FollowSymLinks -Indexes -MultiViews
RewriteEngine on
#
# Externally redirect only direct client requests for /profiles
# URL-paths back to corresponding URL-path in root
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /profiles(/[^\ ]*)?\ HTTP/
RewriteRule ^profiles(/([^/]*))?/?$ http://example.com/$2 [R=301,L]
#
# Externally redirect to remove trailing slash from "user" URL-path requests
# (The requested URL-path is assumed to be a "user" request if it meets the username
# "character-set" requirements and does not resolve to an existing directory)
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /([a-z0-9_-]+)/(\?[^\ ]*)?\ HTTP/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9_-]+)/$ http://example.com/$1 [R=301,L]
#
# Externally redirect to force canonical domain name
RewriteCond %{HTTP_HOST} !^(example\.com)?$
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
#
# Internally rewrite "user" requests to /profiles subdirectory
RewriteCond $1 !^profiles
RewriteRule ^([a-z0-9_-]+)$ /profiles/$1 [L]
Options +FollowSymLinks -Indexes -MultiViews
RewriteEngine on
#
# Externally redirect only direct client requests for /profiles
# URL-paths back to corresponding URL-path in root
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /profiles(/[^\ ]*)?\ HTTP/
RewriteRule ^profiles(/([^/]*))?/?$ http://example.com/$2 [R=301,L]
#
# Externally redirect to remove trailing slash from "/user" URL-path requests
# (The requested URL-path is assumed to be a "/user" request if it meets the username
# "character-set" requirements and resolves to an existing subdirectory of /profiles/)
RewriteCond %{DOCUMENT_ROOT}/profiles/$1/ -d
RewriteRule ^([a-z0-9_-]+)/$ http://example.com/$1 [R=301,L]
#
# Externally redirect to force canonical domain name
RewriteCond %{HTTP_HOST} !^(example\.com)?$
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
#
# Internally rewrite "user" requests to /profiles subdirectory
RewriteCond $1 !^profiles
RewriteRule ^([a-z0-9_-]+)$ /profiles/$1/ [L]