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 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subdomains as part of URL redirect

    Hi all. Here is my existing .htaccess code:
    Code:
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !.*\.(png|jpg|swf|css)$ [NC]
    RewriteCond %{REQUEST_URI} !ajax.*\.php$ [NC]
    RewriteCond %{REQUEST_URI} !index.php
    RewriteRule ^(.+)$ index.php?url=$1
    Essentially all URLs are sent to index.php and I take it from there as I'm more proficient with PHP than all this rewriting malarky! Anyway, this only works with www.domain.com. How can I take EVERY URL and send it to index.php?

    i.e. m.domain.com, tablet.domain.com, img.domain.com and so on?

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Does your httpd.conf file have the same DocumentRoot for www.domain.com and domain.com? Can you post the vhost entries? Specifically the ServerName and ServerAlias?

    You might need something like...
    Code:
    <VirtualHost 12.34.56.78:80>
    ...
    DocumentRoot /var/www/html/www
    ServerName www.example.com
    ServerAlias example.com
    </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
    •