Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

.htaccess rewrite

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  apache server status  
Author Message
mbuna

External


Since: Apr 11, 2004
Posts: 2



(Msg. 1) Posted: Sun Apr 11, 2004 6:22 pm
Post subject: .htaccess rewrite
Archived from groups: alt>apache>configuration (more info?)

Hello.

I'm trying to redirect all requests from http://domain1.com/* to
http://domain2.com/*

I have the following in my .htaccess file in the doc root of
domain1.com:

RewriteEngine on
RewriteCond %{REQUEST_URI} !-U
RewriteRule ^(.+) http://domeain2.com/$1

However requests to domain1.com still end up at domain1.com

Do I have something wrong with my .htaccess code?

Responses via email are preferred since google is often a day behind.

Thanks!

 >> Stay informed about: .htaccess rewrite 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 2) Posted: Mon Apr 12, 2004 1:11 pm
Post subject: Re: .htaccess rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Sean" <mbuna.TakeThisOut@yahoo.com> schreef in bericht
news:385d8a06.0404111422.53609eb7@posting.google.com...
 > Hello.
 > I'm trying to redirect all requests from <a style='text-decoration: underline;' href="http://domain1.com/" target="_blank">http://domain1.com/</a>* to
 > <a style='text-decoration: underline;' href="http://domain2.com/" target="_blank">http://domain2.com/</a>*
 > I have the following in my .htaccess file in the doc root of
 > domain1.com:
 > RewriteEngine on
 > RewriteCond %{REQUEST_URI} !-U
You stated 'all request', so why conditional??
AFAIK this only redirect for missing files.

<font color=purple> > RewriteRule ^(.+) <a style='text-decoration: underline;' href="http://domeain2.com/$1</font" target="_blank">http://domeain2.com/$1</font</a>>
Does this typo matter in real life?

 > However requests to domain1.com still end up at domain1.com
Are you sure your provider allows rewrites per htacess?
Otherwise you might end up with a <base href=http://domain2.com/this-URI> in
each and every HTMLpage.

HansH<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: .htaccess rewrite 
Back to top
Login to vote
mbuna

External


Since: Apr 11, 2004
Posts: 2



(Msg. 3) Posted: Mon Apr 12, 2004 1:11 pm
Post subject: Re: .htaccess rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"HansH" <hans RemoveThis @niet.op.het.net> wrote in message news:<c5dj30$rhc$1@news.cistron.nl>...
  > > RewriteEngine on
  > > RewriteCond %{REQUEST_URI} !-U
 > You stated 'all request', so why conditional??
 > AFAIK this only redirect for missing files.

To be honest I copies this as an example that said it redirects all
files. I'm not familiar with the syntax of these statements. Are you
saying I can get rid of this RewriteCond and just use the Rule below?

<font color=green>  > > RewriteRule ^(.+) <a style='text-decoration: underline;' href="http://domain2.com/$1</font" target="_blank">http://domain2.com/$1</font</a>>
 > Does this typo matter in real life?

No, this is just a typo in my post.

  > > However requests to domain1.com still end up at domain1.com
 > Are you sure your provider allows rewrites per htacess?
 > Otherwise you might end up with a <base href=http://domain2.com/this-URI> in
 > each and every HTMLpage.

Yep, I'm sure that rewrites are allowed<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: .htaccess rewrite 
Back to top
Login to vote
user2348

External


Since: Jun 28, 2003
Posts: 203



(Msg. 4) Posted: Mon Apr 12, 2004 6:08 pm
Post subject: Re: .htaccess rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Sean" <mbuna.TakeThisOut@yahoo.com> wrote in message
news:385d8a06.0404111422.53609eb7@posting.google.com...
 > Hello.
 >
 > I'm trying to redirect all requests from <a style='text-decoration: underline;' href="http://domain1.com/" target="_blank">http://domain1.com/</a>* to
 > <a style='text-decoration: underline;' href="http://domain2.com/" target="_blank">http://domain2.com/</a>*

Another way would be like this:<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: .htaccess rewrite 
Back to top
Login to vote
user2348

External


Since: Jun 28, 2003
Posts: 203



(Msg. 5) Posted: Mon Apr 12, 2004 6:10 pm
Post subject: Re: .htaccess rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Richard Antony Burton" <richardaburton-NOSPAM-.RemoveThis@hotmail.com> wrote in message
news:phyec.12901854$Id.2151295@news.easynews.com...

 > Another way would be like this:

Oops, stupid keyboard.

Like this, (or if you only have access to the httpd.conf, you can just use the
Redirect directive in .htaccess):

<VirtualHost *:80>
ServerName <a style='text-decoration: underline;' href="http://www.domain1.org:80" target="_blank">www.domain1.org:80</a>
ServerAlias *.domain1.org
Redirect permanent / <a style='text-decoration: underline;' href="http://www.domain2.org" target="_blank">http://www.domain2.org</a>
</VirtualHost>

Richard.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: .htaccess rewrite 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 6) Posted: Tue Apr 13, 2004 1:19 am
Post subject: Re: .htaccess rewrite [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Sean" <mbuna DeleteThis @yahoo.com> schreef in bericht
news:385d8a06.0404120736.4c3963f2@posting.google.com...
 > "HansH" <hans DeleteThis @niet.op.het.net> wrote in message
news:<c5dj30$rhc$1@news.cistron.nl>...
   > > > RewriteEngine on
   > > > RewriteCond %{REQUEST_URI} !-U
  > > You stated 'all request', so why conditional??
  > > AFAIK this only redirect for missing files.
 > To be honest I copies this as an example that said it redirects all
 > files. I'm not familiar with the syntax of these statements. Are you
 > saying I can get rid of this RewriteCond and just use the Rule below?
<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewritecond" target="_blank">http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewritecond</a>
" '-U' (is existing URL via subrequest)
Checks if TestString is a valid URL and accessible via all the server's
currently-configured access controls for that path. ... "

HansH<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: .htaccess rewrite 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
REWRITE - I have a movie download site and what i need is that if users are linking my files (like http://www.eengoedidee.nl/videoz/bmx/jib.mpg) that they come to a page for the download. Like this..

Mod Rewrite help - I've got 10,000+ files in a folder http://www.myseite.com/acrhives/ i.e. .../archives/2000/12/, .../archives/2000/11/, .../archives/2000/10/ ... Several years, many months of html mhonarc-archived docs. We have so many files in this one folder, I've..

mod-rewrite - I am attempting to use mod-rewrite to chnage my dynamically created pages into static urlls for search engine submission. I am unable to get the rewrite to work, it doesn't seem to do anything. Here is the code RewriteEngine on RewriteBase..

Mod rewrite - Hallo, I have write in a .htaccess File something like this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?.*? index.php?show=$1&s2=$2&s3=$3&s4=...

rewrite url - Hi, I have two domain names on the same IP-address (IP-host based). How can I redirect one of the domains to another documentroot ? Regards and the best wishes for 2004. Michael
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]