
June 17th, 2005, 05:21 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 2
Time spent in forums: 37 m 33 sec
Reputation Power: 0
|
|
|
htaccess rewriteEngine problem - which one of my variables is wrong?
i am trying to configure a rewrite rule that will redirect foo.bar.com to www.bar.com/okay/foo
i have attempted to alter the script below with no luck
Code:
############################
rewriteEngine On
# Rewrite <subdomain>.example.com/<path> to example.com/<subdomain>/<path>
#
# Skip rewrite if no hostname or if subdomain is www
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
# Extract (required) subdomain (%1), and first path element (%3), discard port number if present (%2)
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.memblog\.com(:80)?<>/([^/]*) [NC]
# Rewrite only when subdomain not equal to first path element (prevents mod_rewrite recursion)
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
# Rewrite to /subdomain/path
RewriteRule ^(.*) /%1/$1 [L]
can any one help me please
thanks
|