d4rq000z
d4rq000z

Reputation: 3

How to Code an .htaccess Redirect Without Changing the Address Bar

Hiho,

I would like redirect: http://ads.polishexpress.co.uk/en
to
http://ogloszenia.polishexpress.co.uk/en
without change adress bar.

My attempt is displayed in the code below:


    RewriteEngine on
    # Use PHP5.4 as default
    AddHandler application/x-httpd-php54 .php
    RewriteCond %{HTTP_HOST} ^ads\.polishexpress\.co\.uk$ [OR]
    RewriteCond %{HTTP_HOST} ^ads\.polishexpress\.co\.uk\/en$
    RewriteRule ^/?$ "http\:\/\/ogloszenia\.polishexpress\.co\.uk\/en" [L]

Upvotes: 0

Views: 60

Answers (1)

JM Mayo
JM Mayo

Reputation: 319

Try this rule:

RewriteCond %{HTTP_HOST} ads\.polishexpress\.co\.uk
RewriteRule ^(.*)$ http://ogloszenia.polishexpress.co.uk/$1 [r=301,nc]

Upvotes: 1

Related Questions