mod rewrite help

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

mod rewrite help

Postby bojomojo » Sun Dec 07, 2008 10:24 am

Can I use mod_rewrite to rewrite local urls to external ones.

The thing is i want to display my helpdesk to my resellers on thier websites while offer the support.

Basically is it possible for mod rewrite to do the external rewriting?

for example:
when the user clicks on support.domain.com
it goes to domain2.com/support

is it possible? and how
bojomojo
 
Posts: 2
Joined: Sun Dec 07, 2008 10:23 am

Advertisement

Postby hroudel » Sun Dec 07, 2008 12:23 pm

Yap it is possible by htaccess redirection

Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteRule http://support.domain.com http://domain2.com/support [R=301,L]
hroudel
 
Posts: 14
Joined: Thu Nov 27, 2008 3:43 pm

Postby bojomojo » Mon Dec 08, 2008 4:50 pm

it is not working
bojomojo
 
Posts: 2
Joined: Sun Dec 07, 2008 10:23 am

Postby hroudel » Wed Dec 10, 2008 4:41 pm

Ok my fault. Here is proper. Rewritecond is condition. So if domain name begins support.domain.com continues to RewriteRule. If behind domain name is any or none char or chars go to -http://domain2.com/support. R=301 marks that this redirection is permanent. So search engines should remember new domain name :)

Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^support.domain.com
RewriteRule ^(.*) http://domain2.com/support [R=301,L]
hroudel
 
Posts: 14
Joined: Thu Nov 27, 2008 3:43 pm


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests