www restriction ignored
sersim - February 5, 2009 - 18:26
| Project: | Subdomain |
| Version: | 6.x-1.4 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
It would be nice to have an option like "set www subdomain as default".
I needed to make www.example.com the default url, instead of example.com.
In order to do this, I've modified the subdomain module at the row 407:
else {
$options['base_url'] = 'http://www.'. subdomain_base_domain();
}And I've modified the functions custom_url_rewrite_inbound and custom_url_rewrite_outbound in my settings.php in this way:
function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
// Used by the Subdomain module to generate URLs with subdomains
if (module_exists('subdomain') and arg(0,$path)!='views') {
subdomain_url_rewrite_outbound($path, $options);
}
}
function custom_url_rewrite_inbound(&$result, $path, $path_language) {
// Used by the Subdomain module to correctly interpret URLs with subdomains
if (module_exists('subdomain') and arg(0,$path)!='views' and
substr($_SERVER['HTTP_HOST'],0,3)!='www') {
subdomain_url_rewrite_inbound($result, $path, $path_language);
}
} The "views" part is a fix to an issue related to the views module ajax pager not working in subdomain pages.

#1
I have had problems using www in my URL using the subdomain module but using your code snippets made it work like a charm, thank you so much sersim :-)
//Patrik
#2
I'm happy too see that my code snippet is useful for other users.
#3
I have seen that allot of others have had the same problem, by posting issues here. I'm not sure about how things work with patching, but wouldn't your snippets be suited as a patch?
#4
Fixed the www issue in CVS. It should be available in the next dev release.
The views patch i need to look at a little bit more to see how best to solve it (A similar issue affects the javascript in voting modules as well).
Renaming the issue to include views issue
#5
www issue is fixed for both 5.x and 6.x...
#6
Automatically closed -- issue fixed for 2 weeks with no activity.
#7
What about Ajax pagers on block views???This solution fixes block views within sub-domain pages. yay!
#8
closing