Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 01-10-2005, 19:00   #1 (permalink)
Duende
Civilians

 
Default RewriteEngine On question

Problem:
contents of a directory needs to be redirected to its own new domain. What is
the best way?

This seams like it should work but doesn't. Why?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com/directory/$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]

This is working.
RedirectMatch 301 /domain/(.*) http://newdomain.com/$1

--
D?
http://wipkip.biz just to raise my PR
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 01-10-2005, 20:00   #2 (permalink)
Toby Inkster
Civilians

 
Default Re: RewriteEngine On question

Duende wrote:

> RewriteCond %{HTTP_HOST} ^domain\.com/directory/$ [NC]


HTTP_HOST only contains the host name -- not the full URL, so this will
never match.

Try:

RewriteEngine On
RewriteRule ^/directory/(.*)$ http://newdomain.com/$1 [R=301,L]

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-10-2005, 21:00   #3 (permalink)
Duende
Civilians

 
Default Re: RewriteEngine On question

While sitting in a puddle Toby Inkster scribbled in the mud:

> Duende wrote:
>
>> RewriteCond %{HTTP_HOST} ^domain\.com/directory/$ [NC]

>
> HTTP_HOST only contains the host name -- not the full URL, so this will
> never match.
>
> Try:
>
> RewriteEngine On
> RewriteRule ^/directory/(.*)$ http://newdomain.com/$1 [R=301,L]
>


Sorry Toby but that was a no-go. Guess I'll stay with:

RedirectMatch 301 /directory/(.*) http://newdomain.com/$1

Thanks

--
D?
http://wipkip.biz just to raise my PR
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[MV] RTV Question Chris Brunner MV List 1 04-22-2006 00:12
DNS question/Webhosting question s t e v e o Web Design 3 03-29-2005 04:00
A needed workaround for RewriteEngine in .htaccess with FP X Web Design 0 01-28-2005 08:00
Question Chis Boynton BaseBall 21 10-22-2004 12:00
Well? 1.6 question PAVELB1 Gaming club 1 08-04-2004 23:45


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 09:57.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.89716 seconds with 19 queries