Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-11-2011, 11:02 AM   PM User | #1
nxzmplty
New Coder

 
Join Date: Jan 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
nxzmplty is an unknown quantity at this point
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?
nxzmplty is offline   Reply With Quote
Old 12-11-2011, 04:48 PM   PM User | #2
bcarl314
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
bcarl314 will become famous soon enough
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>
bcarl314 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:57 AM.


Advertisement
Log in to turn off these ads.