Forum Moderators: phranque
I have a second level domain (www) example.com redirecting to a
third level domain blog.example.com by "redirect 301".
I'd like it worked for every query of (www) example.com but one file, for
example (www) example.com/minisite_1.html
How can i do that ? How about adding a second file, say example.com/minisito_2.html, to be excluded from "redirect 301" to blog.example.com ?
sorry for my English.
Thanks in advance,
Simon from Italy
[edited by: jdMorgan at 10:11 pm (utc) on Sep. 1, 2009]
[edit reason] Please use example.com [/edit]
You could also use mod_rewite, and use one or more RewriteConds to exclude one or more requested files or URL-paths (or many other request characteristics) from being redirected.
Jim
RewriteCond $1 !^minisite_1\.html$
RewriteCond $1 !^minisite_2\.html$
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com
RewriteRule ^(.*)$ http://blog.example.com/$1 [R=301,L]
You can combine the first two RewriteConds into one if you like, but using the "local OR" operator:
RewriteCond $1 !^(minisite_1¦minisite_2)\.html$
Jim