Forum Moderators: phranque

Message Too Old, No Replies

Is this correct rewrite syntax? I can't test it yet...

mod_rewrite now location

         

dougpd

12:22 pm on Nov 2, 2003 (gmt 0)

10+ Year Member



I'm moving an old directory to a new subdomain location.

I'm not ready to make this live, so I can't test it to see if it is right. But, I've been reading up on this since my last post...


RewriteCond %{HTTP_HOST} !^www\.example\.org/Resources/.*$ [NC]
RewriteRule (.*) http://resources.example.org/category/$1 [R=301,L]

TIA

[edited by: jdMorgan at 7:54 pm (utc) on Nov. 2, 2003]
[edit reason] Examplified & delinked URL [/edit]

jdMorgan

7:55 pm on Nov 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



dougpd,

What you have reads as follows:
IF {HTTP_HOST} name does Not start with "www.example.org/Resources/"
THEN redirect all requested files to the files in the http://resources.example.org/category/ subdomain and subirectory.

I suspect you don't really want the NOT operator - indicated by the "!" character, but I can't tell from your posted description.

Jim

closed

4:35 am on Nov 3, 2003 (gmt 0)

10+ Year Member



Ditto what Jim said.

Plus you'd probably have to split your RewriteCond into two conditions, one checking HTTP_HOST for the domain, and another checking REQUEST_URI for the directory.

Then it should work. Hopefully. :-)