Forum Moderators: phranque

Message Too Old, No Replies

'Fake'Subdomain Rewrite stopped working - http.conf or htaccess?

htaccess Rewrite suddenly not working

         

dumbo

6:08 pm on Jul 10, 2009 (gmt 0)

10+ Year Member



Hello

I've searched the forum and can see it's full of v. smart people so I'm hoping one of you will be able to help me!

I 'inherited' a website (online memorials) to maintain and have been fine although I'm no php/htaccess knowitall, but the subdomain rewrite has suddenly stopped working and I haven't made any changes to the htaccess or any other site files.

The host (ehostpros) are utterly useless and, despite having updated their server the same day this stopped working (hmmm, suspicious) they say this isn't the reason for the problem. Right...

I'm a bit lost with how to troubleshoot/fix this and would appreciate any help you can offer.

The site in general is working fine, however when I click on plot links, which should redirect to, e.g. [firstname-lastname.domain.com...] it is showing the cpanel page instead of the plot page. Ehostpros say this is because it does not have a virtual host entry in httpd.conf and there is no folder called rachel-hollenbach under the public_html directory.

Here is the rewrite section of the htaccess file:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com$ [NC]
RewriteCond %1 !^www$ [NC]
RewriteRule ^$ /plot/plot.php\?plot_url=%1 [L]

Can anyone tell from this excerpt why it's not working and how to fit it?

Really appreciate you taking the time to help/look at this.

Thanks in advance,
Kerry

jdMorgan

6:34 pm on Jul 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



They have apparently 'broken' something about the site. What was the "upgrade" -- specifically?

If they upgraded your 'control panel' they may have deleted your wildcard-subdomain-to-server-IP-address mapping. If they "upgraded" your account, they may have moved you from an IP-based virtual host to a name-based virtual host -- make sure you still have your unique IP address (it should not have changed). Be aware that it will not be possible to support wildcard (multiple and arbitrary) subdomains on a name-based shared server, so if they changed this, you must get it changed back.

If your domain is not registered with your hosting company, but rather is a separate account, then check your DNS zone file and make sure it's still correct for whatever your new server setup is.

There's nothing critically wrong with your code, except that it won't recognize and rewrite requests made to FQDN hostnames or to hostnames with appended port numbers. And actually, those should be redirected as part of your domain name canonicalization redirect rule(s) anyway, and not handled in this rule here.

Jim

dumbo

6:56 pm on Jul 10, 2009 (gmt 0)

10+ Year Member



Hi Jim

Thanks for the speedy reply!

This is the message the hosts sent my client regarding hte server update:

We would like to inform you that due to security reasons we have changed couple of settings related to perl and cgi. We have blocked the .cgi .pl .plx .ppl .perl scripts using outside of the cgi-bin folder due to security purpose,so to use those handlers please keep in cgi-bin folder. By allowing these above handlers in other folders spammers are running spam scripts at root level folders and sending spam mails from server. Due to this IP is getting frequently blocked by email providers. We request you please kindly keep handlers in cgi-bin folder.

The domain is registered via enom and the DNS just points to the two nameservers for the hosting company (ehostpros).

There was no mention of IP address changes and I would imagine that would have affected the entire site, not just this particular rewrite function for the plot pages?

Not sure if this makes it any clearer?

Thanks again,
Kerry

jdMorgan

7:03 pm on Jul 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



They changed more than what they said they changed, obviously...

Go check the DNS records in your host's nameservers, and make sure your wildcard subdomain is still pointed to your server. And check everything else I described above as well.

Your host broke your site. They should help you fix it. If not, pay for a better host with good support. It's worth it.

Jim