Forum Moderators: phranque

Message Too Old, No Replies

Invisible redirect

I'm showing certain content based on the URL

         

donovanh

11:30 am on Aug 24, 2005 (gmt 0)

10+ Year Member



Hi,

I have a site that I'm internationalising, and trying to do so by putting an invisible redirect from the local domain to the main site. I'd like the local domain to remain in the browser, as the site uses PHP to look at the current SERVER_NAME and keep the links/content in line.

I've tried many htaccess configurations but even though I've been doing this for months I just don't understand it. My htaccess is currently as follows:

RewriteEngine On
RewriteCond %{HTTP_HOST} example\.co.uk
RewriteRule (.*) http://www.example.com/$1 [L]

However while this may sort of work, it doesn't hide the redirect. Any ideas?

Many thanks,

Don

donovanh

12:33 pm on Aug 24, 2005 (gmt 0)

10+ Year Member



Decided after a bit more reading that inter-domain rewriting isn't going to work.

However the alternative seems to be to park the second domain as an alias. I did this through cPanel, resulting in the following line being added to the httpd.conf file:

ServerAlias example.co.uk www.example.co.uk

However having removed the example.co.uk account, it just shows a "There is no site at this address" cPanel screen.

I've restarted apache but no luck. Anyone know why a parked domain would do this?

Thanks,

Don

jdMorgan

9:26 pm on Aug 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The question is "what is a 'parked domain' by cpanel's definition?" If you're using cpanel, then that adds another layer of complexity over and above Apache. It sounds like it changed something else and 'undefined' that domain somehow.

Jim

donovanh

8:40 am on Aug 25, 2005 (gmt 0)

10+ Year Member



Thanks for the reply jd.

My impatience seems to have got the better of me, the procedure involved pointing the site to a different IP, so somewhere along the line something had cached the old IP, resulting in the server basically saying "Site? What site?"

It seems to have worked itself out now :)

jdMorgan

8:16 pm on Aug 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's important to flush your browser cache after any change to any access-control code. Otherwise, your browser may serve you whatever result it got the last time you requested a particular URL. If the browser is serving from its cache, then the request is never sent to your server, and so your access-control code can have no effect.

Jim