Syndicate content

Why would Redirect and RedirectMatch in Apache2 not work?

As we are working on a new website, we had a problem where a redirect would not work. I tried both: a simple Redirect and a RedirectMatch as follow:

Redirect / http://finball.m2osw.com/
RedirectMatch permanent ^(.*)$ http://finball.m2osw.com$1

Both of these entries would not work at all.

I verified, to make sure, that the alias module was turned on. It was.

ls -l /var/apache2/mods-enabled

This did list the alias.conf and alias.load entries as expected.

So? What else?

Well... This was installed on a new server and we left the default entry in there:

ls -l /var/apache2/sites-enabled

would show:

lrwxrwxrwx 1 root root 35 Feb 11 10:37 000-default.conf -> ../sites-available/000-default.conf

and somehow the default entry had priority over our virtual entry! I think that is because the default had no ServerName entry.

I just deleted the default, because really I don't need all sorts of weird accesses accepted, and it started to work as expected. The RedirectMatch was doing its job.

Syndicate content

Diverse Realty

Diverse Realty Team

Want a New Home?
Want to Sell Your House?

Call Alex at
+1 (916)
220 6482

Alexis Wilke, Realtor
Salesperson
Lic. # 02024063

Cory Marcus, Broker
Lic. # 01079165

     

Terms of Site Index

Find the page/content you are looking for with our index.

  • CSV
  • atom

    In Web Technology, an Atom is a feed that is used to inform listeners of changes (new pages) from different websites.

  • clean
  • su

    Unix command line function to switch to super user mode. This function works on most system as long as the super user has a password. Otherwise, see sudo instead.

  • validation