Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htaccess rewriteEngine problem- which of my variables is wrong

Status
Not open for further replies.

verbatim1

Programmer
Apr 18, 2005
58
US
i am trying to configure a rewrite rule that will redirect foo.bar.com to
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} !^[URL unfurl="true"]www\.[/URL] [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
 
I tried
Code:
rewriteEngine On 
rewriteCond %{HTTP_HOST} ^foo\.bar\.com
rewriteRule (.*) /okay/foo [L]

with no luck ,

any suggestions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top