Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×
The Internet

Journal OctaneZ's Journal: Apache and mod_rewrite 1

I wish apache had a mechanism to use mod_rewrite without having to have a vhost for each domain that you want to redirect. At the moment I have this defined in each vhost I want to redirect:

RewriteEngine on
RewriteCond %{HTTP_HOST}$ [NC]
RewriteRule ^(.*)$$1 [R]

Am I missing something obvious?

This discussion has been archived. No new comments can be posted.

Apache and mod_rewrite

Comments Filter:
  • by Anonymous Coward
    If you're complaining that you have to have vhosts for,,,, and so on and so forth to get everything to redirect to, then you just need the vhost, and outside of that vhost, use rewrite to rewrite everything to (with a RewriteCond set to skip itself. I don't think this will loop without one, but it will put an extra burden on the server).

    You can also set up a file to map various addresses to multiple vhosts, rather than ma

Neutrinos are into physicists.