Rewrite Help Please....

New to mod_rewrite? This is a good place to start.

Rewrite Help Please....

Postby hammer995 » Wed Feb 04, 2004 2:15 pm

Ok...so this is the first time I need to use this and I have a few questions..

1) Do I have to restart the server everytime I edit .htaccess...I think no since it reads it everytime anyway right?

2) I need to just switch the hostname to a full qualified domain name for only a subdirectory for cookie purposes.

for example

http://hostname/subdir/index.html -> http://hostname.domain.com/subdir/index.html

I think this is pretty easy but I am not able to get it going.

The examples I found are the following:
RewriteEngine On
RewriteBase /subdir
RewriteCond %{HTTP_HOST} !^hostname\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://hostname.domain.com/$1 [L,R]

This doesn't work.

Thanks in advance,
Sonny
hammer995
 
Posts: 1
Joined: Wed Feb 04, 2004 2:08 pm

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 32 guests

cron