Forum Moderators: phranque
1)Can you please provide me with the mod_rewrite code which is equivalent to redirect command in .htaccess.
That is ,
redirect /page.html [otherdomain.com...]
2) Redirect the domain to a new destination,
that is
[domainname.com...] should go to [seconddomainname.com...]
3) Redirect the domain to a folder in the same account,
That is
[domainname.com...] should go to [domainname.com...]
Thank you ,
Vincent
I'm sorry, but our forum charter [webmasterworld.com] prohibits writing code-on-demand here; We simply can't support such requests with the small number of contributors we have here. Our purpose is to discuss Apache-related topics, not to serve as a free code-writing service.
Perhaps the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com] will be helpful to you.
Jim
Can you please help me to redirect the domain to yahoo, actually I am not getting how to do it.
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} example.net
RewriteCond %{REQUEST_URI}!yahoo.com
RewriteRule ^(.*)$ yahoo.com/$1 [L]
[edited by: jdMorgan at 2:52 pm (utc) on June 23, 2006]
[edit reason] Exampleified. No URLs, please. See TOS. [/edit]
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
#
# Redirect requests for pages on example.net to corresponding pages in "folder" on yahoo.com
RewriteCond %{HTTP_HOST} example\.net
RewriteRule (.*) http://www.yahoo.com/folder/$1 [R=301,L]
WebmasterWorld membership levels are based on post count, not on sign-up date.
Jim
that code you gave earlier works fine , however I used same code to redirect a sub domain to an external URL but it gives just page not found error. There is no issue with the external URL
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} subdomain.foo.com
RewriteRule (.*) http://subdomain2.example.net/email/scripts/index.pl/$1 [L]
[edited by: jdMorgan at 2:15 pm (utc) on June 29, 2006]
[edit reason] No URLs, please. See TOS. [/edit]