mod_rewrite not functioning on IP

Hi Guys!

I have a few mod_rewrite rules that im trying to get working on an IP address. However, they don’t seem to work. It is imprtant to note that exactly the same file works perfectly on a normal domain.

Here are the rules:


RewriteEngine on
RewriteRule company/(.*)/(.*).html viewjob.php?companyurl=$1&jobtitle=$2 [NC,L]
RewriteRule news/(.*).html news.php?newsurl=$1 [NC,L]
RewriteRule industries/(.*) directory.php?type=industry&url=$1 [NC,L]
RewriteRule locations/(.*) directory.php?type=location&url=$1 [NC,L]
RewriteRule job-types/(.*) directory.php?type=jobtype&url=$1 [NC,L]
RewriteRule company/(.*) directory.php?type=company&url=$1 [NC,L]
RewriteRule ^uploads/users/cvs/([a-zA-Z0-9_-]+\\.docx?)$ - [F]

Is there anyway I can get this working on the following url:

http://xx.222.xxx.10/~username/

Thanks.

Zaggs,

mod_rewrite is dependent upon getting the request from the local DNS and the Apache settings (which should include enabling mod_rewrite and Allow Override - the details are in the setup section of the tutorial in my signature). In other words, the domain has nothing to do with it whatsoever (except that a redirection which is not “internal” will be sent to another domain with its own DNS and Apache).

My only comment on your regex is to ask WHY you are using No Case when Apache needs to match the case of URI strings (i.e., lose the NC flags - they don’t help and CAN hurt your effort).

Regards,

DK