PDA

View Full Version : Simple mod_rewrite and .htaccess question



c4r
02-13-2007, 11:56 AM
Hopefully an easy question (sorry if it's been addressed...couldn't find what I needed searching).

How do I do a mod_rewrite to have

subdomain.domain.com/cgi-bin/routine.pl/xyz
pull up
domain.com/cgi-bin/routine.pl/xyz/subdomain
where subdomain and xyz are subject to change/not hardcoded.

Something like this?

rewriteRule ([a-zA-Z0-9_-+).domain.com/cgi-bin/routine.pl/([a-zA-Z0-9_-+)$ domain.com/cgi-bin/routine.pl/$2/$1

Thanks!

RDM
02-13-2007, 12:33 PM
You can't. This would need to have wild card sub-domains enabled in apache and HM does not allow wild card sub-domains. The sub-domain has to actually exist in cPanel.

c4r
02-13-2007, 12:51 PM
so THAT'S why I haven't been able to get it work.

Too bad you don't have it enabled. It would make my (and others) life so much easier. I may have to search for a host that allows that.

Thanks for the info.

RDM
02-13-2007, 01:28 PM
so THAT'S why I haven't been able to get it work.

Too bad you don't have it enabled. It would make my (and others) life so much easier. I may have to search for a host that allows that.

Thanks for the info.

FYI, this is a user to user forum and I do not work at HM nor do the admins or employees of HM read/post here.