Forum Moderators: phranque
# switch on mod_rewrite ##
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# For non-www subdomain requests, the query string parameter 'user' is taken from the requested subdomain (%1)
rewriteCond %{HTTP_HOST} ^([^.]+)\.superFolder\.[a-z]{2,3}
rewriteCond %{REQUEST_FILENAME} !^(.+)\.(css|js|swf)$
rewriteRule ^([^/.]*) superFolder/HTML/viewer.php?user=%1&urlb=$2 [QSA,L]
# if the request_uri has more than "/" and is not from the /HTML directory don't redirect
rewriteCond %{REQUEST_URI} ^/(.+)$
rewriteCond %{REQUEST_URI} !^(.+)/HTML/(.+)$
rewriteRule ^(.*)$ superFolder/HTML/%{REQUEST_URI} [L]
# enable mod_rewrite
Options +FollowSymLinks
#
# enable the rewriting engine
RewriteEngine on
#
# reset rewritebase to default
RewriteBase /
#
# For non-www subdomain requests of top-level extensionless URL-paths, invoke the "viewer.php"
# script, passing it the requested subdomain and URL-path as query string parameters
RewriteCond %{HTTP_HOST} !^www\.example\.[a-z]{2,3}
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.[a-z]{2,3}\.?(:[0-9]+)?$
RewriteRule ^([^/.]*)$ superFolder/HTML/viewer.php?user=%1&urlb=$2 [QSA,L]
Requirements:
Do rewrite URL-paths matching "/<any-path-not-containing-slashes-or-periods>"
Do not rewrite URL-paths matching "/<any-path-which-contains-slashes-or-periods>"
rewriteCond %{REQUEST_URI} ^(.*)$
rewriteRule ^([^/.]*) /superFolder/HTML%{REQUEST_URI} [QSA,L]
All I know that %{HTTP_URI} always starts with "/" and it will have more data if there is some kind of path there. So If that happens, it should start from there: [i]/superFolder/HTML/%{REQUEST_URI}[/i]. [edited by: engine at 2:08 pm (utc) on Apr 28, 2010]
[edit reason] fixed typo [/edit]
RewriteCond (%{REQUEST_URI}) ^.*$
RewriteRule ^.*$ superFolder/HTML/$0 [QSA,L]
RewriteCond (%{REQUEST_URI}) ^.*$And it works!....
RewriteRule ^.*$ superFolder/HTML/viewer.php?urlb=$0 [QSA,L]
[b]RewriteRule ^.*$ http:// %{SERVER_NAME}/superFolder/HTML%{REQUEST_URI} [QSA,R,L][/b] http://www.domainName.com/preLoader.swf http://www.domainName.com/superFolder/HTML/preLoader.swf http://www.domainName.com/superFolder/HTML/superFolder/HTML/preLoader.swf http://www.domainName.com/superFolder/HTML/superFolder/HTML/superFolder/HTML/preLoader.swf [edited by: jdMorgan at 11:12 pm (utc) on Apr 28, 2010]
[edit reason] TOS #20 [/edit]