Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    42
    Thanks
    5
    Thanked 0 Times in 0 Posts

    URL Rewrite in Virtual Hosts

    Is it possible to put URL Rewrite in the virtual hosts configuration instead of a .htaccess file?

    Just wondering as I host multiple sites it would be easy to set it in virtual hosts than making numerous .htaccess files.

    Thanks

  • #2
    New Coder
    Join Date
    Jul 2011
    Posts
    67
    Thanks
    0
    Thanked 13 Times in 13 Posts
    Short answer, yes.

  • #3
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    Long answer, yessssssss.

  • #4
    New Coder
    Join Date
    Jan 2011
    Posts
    42
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Thanks for both the short and long answer guys... especially the long one, you really took your time and went into some depth there, very helpful...

    Haha, anyway I got it working, just wanted to redirect to the www. version of the site, did the following in virtual hosts...

    <VirtualHost>
    ...
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^example\.com$
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
    </VirtualHost>



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •