Forum Moderators: phranque
I use this rule and I need some little help
RewriteCond %{HTTP_HOST} !^www\.website\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.website\.com$ [NC]
RewriteRule ^$ [website.com...] [L]
and result
hello-world.website.com to www.website.com/index.php?x=arama&kelime=hello-world
but I need replace (-) to (+)
hello-world.website.com to www.website.com/index.php?x=arama&kelime=hello+world
how to change my rule.
sorry for bad english
all the singers, I would like to subdomain. e.g.
michael-jackson.mywebsite.com
elvis-presley.mywebsite.com
When using this code
RewriteCond %{HTTP_HOST} !^www\.website\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.website\.com$ [NC]
RewriteRule ^$ [website.com...] [L]
between words - I want to replace +
I want to 301 redirect
I'd recommend an internal rewrite.
I'd also suggest changing the "-" characters to "+" characters using preg_replace within the index.php script itself; Replacing characters using mod-rewrite is *terribly* inefficient, especially when the number of characters to be replaced can vary.
Finally, pick either <artist>.example.com or www.<artist>.example.com as the canonical domain and redirect the non-canonical domain to the selected canonical one. Do not allow both to resolve directly to content. See the "duplicate content" threads in the "Google Hot Topics FAQ" section of our Google News forum for more information.
Jim