Forum Moderators: phranque
I have the same domain name but one is a .com and one is a .net. The .com one is parked.
I have also have a subdomain that I want to work on both the .com and .net. Is there any way to get this to work;
[subdirectory.sitename.net...] works, but I want [subdirectory.sitename.com...] to work also.
I would want this to work also though; [subdirectory.sitename.net...] works but would need this to work: [subdirectory.sitename.com...]
Here is my current .htaccess;
RewriteRule ^site:(.*)/(.*)/(.*)/(.*)$ site.php?module=$1&page=$2&op=$3&ex=$4 [L]
RewriteRule ^site:(.*)/(.*)/(.*)$ site.php?module=$1&page=$2&op=$3 [L]
RewriteRule ^site:(.*)/(.*)$ site.php?module=$1&page=$2 [L]
RewriteRule ^site:(.*)$ site.php?module=$1 [L]
RewriteRule ^_(.*)/(.*)/(.*)/(.*)$ site.php?module=$1&page=$2&op=$3&ex=$4 [L]
RewriteRule ^_(.*)/(.*)/(.*)$ site.php?module=$1&page=$2&op=$3 [L]
RewriteRule ^_(.*)/(.*)$ site.php?module=$1&page=$2 [L]
RewriteRule ^_(.*)$ site.php?module=$1 [L]
Any suggestions?
Thanks,
Corey
[edited by: jdMorgan at 11:18 pm (utc) on Nov. 16, 2007]
[edit reason] Disabled smilies resulting from code [/edit]
In outline, you must change your DNS zone files so that all domain variants are pointed to your server's IP address. You must then change your server configuration so that all these variants are recognized, and 'pointed' to your 'main' site's hosting space (where your code is located).
Once you've accomplished that, you rules will work for all of your domain names and TLDs. However, at that point, I'd suggest you come back and ask how your rules can be made more efficient -- much more efficient. :)
Jim
[edited by: jdMorgan at 9:10 pm (utc) on Nov. 16, 2007]
Doesn't "Parked Domains" on Cpanel already do that?
The usual approach, as I recall, is to use the "add-on domain" function, and then try to rewrite all URLs to the files in the add-on subdirectory. While it might be more desirable to rewrite them all back to root, this often doesn't work -- at least according to what I see here.
Jim