I've spent hours reading threads on the forum but I'm probably too n00b to completely understand everything and be able to start writing rules from scratch so I'd appreciate your help
First of all I need to redirect different domains to the same website and this is the code I used in my .htaccess file:
- Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^haransite.com [NC]
RewriteRule ^(.*)$ http://www.haransite.com/$1 [R=301]
RewriteCond %{HTTP_HOST} ^haransite.net [NC]
RewriteRule ^(.*)$ http://www.haransite.com/$1 [R=301]
RewriteCond %{HTTP_HOST} ^www.haransite.net [NC]
RewriteRule ^(.*)$ http://www.haransite.com/$1 [R=301]
This code does work only in the homepage. How can I solve it?
Second problem, the actual CMS's structure cannot be modified, the only thing I can do is to append content, taken from the db, to the URLs.
Here are a couple of examples of rewriting I'd like to do:
http://www.haransite.com/public/index.cgi
to
http://www.haransite.com/
and
http://www.haransite.com/public/destina ... ETF4VG8RGH&loc=3DEVHHRXAENW
to
http://www.haransite.com/destinations/g ... TF4VG8RGH-3DEVHHRXAENW
(The text in orange doesn't always occur, just sometimes in the homepage links.)
There are other cgi scripts in the cms folders but the queries usually remain almost the same.
Here it is the main structure of my CMS:
/ (root)
/public
/admin
/cpanel
admin and cpanel will become subdomains (admin.haransite.com & cpanel.haransite.com) so the main site will be in public.
Could you please help me to start? I just need a hint, an example just to begin writing.
Since I've full control over the server, do you think I should place the rules in the .htaccess or inside the virtual-host config file?
Thanks,
Haran