Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: mod_rewrite and wildcard DNS |
|
Author |
|
Echilon
Joined: 28 May 2007 Posts: 1 Location: England
|
Posted: Mon 28 May '07 15:03 Post subject: mod_rewrite and wildcard DNS |
|
|
I'm having problems with rewriterule. Ity's always a buit hit and miss, but I can't figure out why it's not working this time. I wan to change from having a load of arguments in the URL to having a directory/subdirectory structure. I have wildcardDNS enabled, and the code below rewrites every subdomain to an argument - eg: http://blah.mydomain.net/ becomes http://mydomain.net/index.php?cal=blah.
Quote: |
RewriteCond %{HTTP_HOST} !^(www|images)\.mydomain\.net$
RewriteCond %{HTTP_HOST} !^mydomain\.net$
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.net$
RewriteRule (.*) /home/mydomain/index.php?cal=%1
|
The problem is, I want to pass more paramaters, so http://blah.mydomain.net/rss/ becomes http://mydomain.net/index.php?cal=blah&act=rss. I've tried using another rewrite rule, but I can't get it working. I *think* it should be something like this:
Quote: |
RewriteCond %{HTTP_HOST} !^(www|images)\.mydomain\.net$
RewriteCond %{HTTP_HOST} !^mydomain\.net$
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mydomain\.net$
RewriteRule ^rss/?$ /home/mydomain/index.php?cal=%1&act=rss [S,L]
RewriteRule (.*) /home/mydomain/index.php?cal=%1
|
Could anyone lend a hand? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|