This is a discussion on xampp permanent re-direct within the Apache Web Server forums, part of the Web Server and Related Forums category; I am trying to do some local testing of re-directs. I need to be able to take site1/page1....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am trying to do some local testing of re-directs. I need to be able
to take site1/page1.html and re-direct it to site2/pageX.php I wrote one for page1.html to page1.php but so far I am having no luck with changing directories. A point in the right direction would be greatly appreciated. -- TK http://www.wejuggle2.com/ Still Having a Ball ----== Posted via Pronews.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.pronews.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= - Total Privacy via Encryption =--- |
|
|||
|
"Terry" <tknoat@wejuggle.com> wrote in message news:1205073366_480@isp.n...
> I am trying to do some local testing of re-directs. I need to be able > to take site1/page1.html and re-direct it to site2/pageX.php I wrote > one for page1.html to page1.php but so far I am having no luck with > changing directories. > > A point in the right direction would be greatly appreciated. Try this & let us know if it worked?: RewriteEngine on RewriteLog "rewrite.log" RewriteLogLevel 1 RewriteCond %{REQUEST_URI} ^mysite.com/page1.html$ [NC] RewriteRule ^mysite.com/page1.html$ http://www.theirsite.com/pagex.php [NC,R,L] ^ = Start of string $ = End of string NC = NoCase (Not case sensitive) R = Redirect (external-like) L = Last rule (Dont process more for this condition) |
|
|||
|
Trammel wrote:
> "Terry" <tknoat@wejuggle.com> wrote in message news:1205073366_480@isp.n... >> I am trying to do some local testing of re-directs. I need to be able >> to take site1/page1.html and re-direct it to site2/pageX.php I wrote >> one for page1.html to page1.php but so far I am having no luck with >> changing directories. >> >> A point in the right direction would be greatly appreciated. > > Try this & let us know if it worked?: > > RewriteEngine on > RewriteLog "rewrite.log" > RewriteLogLevel 1 > RewriteCond %{REQUEST_URI} ^mysite.com/page1.html$ [NC] > RewriteRule ^mysite.com/page1.html$ http://www.theirsite.com/pagex.php ^^^^^^^^^^ I don't think that should be there. You can't test the host name in a RewriteRule that way. > [NC,R,L] > > ^ = Start of string > $ = End of string > NC = NoCase (Not case sensitive) > R = Redirect (external-like) > L = Last rule (Dont process more for this condition) > > |
|
|||
|
"Jim Hayter" <see.reply.to@nowhere.invalid> wrote in message
news:13tddekqbbnic99@news.supernews.com... > Trammel wrote: > > "Terry" <tknoat@wejuggle.com> wrote in message news:1205073366_480@isp.n... > >> I am trying to do some local testing of re-directs. I need to be able > >> to take site1/page1.html and re-direct it to site2/pageX.php I wrote > >> one for page1.html to page1.php but so far I am having no luck with > >> changing directories. > >> > >> A point in the right direction would be greatly appreciated. > > > > Try this & let us know if it worked?: > > > > RewriteEngine on > > RewriteLog "rewrite.log" > > RewriteLogLevel 1 > > RewriteCond %{REQUEST_URI} ^mysite.com/page1.html$ [NC] > > RewriteRule ^mysite.com/page1.html$ http://www.theirsite.com/pagex.php > ^^^^^^^^^^ > I don't think that should be there. You can't test the host name in a > RewriteRule that way. > > > [NC,R,L] > > > > ^ = Start of string > > $ = End of string > > NC = NoCase (Not case sensitive) > > R = Redirect (external-like) > > L = Last rule (Dont process more for this condition) Ok... so test in the vhosts file (without the original site being stated): RewriteEngine on RewriteLog "rewrite.log" RewriteLogLevel 1 RewriteCond %{REQUEST_URI} ^/page1.html$ [NC] RewriteRule ^/page1.html$ http://www.theirsite.com/pagex.php [NC,R,L] |
| Thread Tools | |
| Display Modes | |
|
|