logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: htaccess internal redirect
Author
quali74



Joined: 13 Oct 2006
Posts: 2

PostPosted: Fri 22 Feb '13 13:03    Post subject: htaccess internal redirect Reply with quote

hello,

Need some help on this redirect.

I have a site called: www.a.co.uk and it contains a page called page1. www.a.co.uk/folder1/page1

I have other domains connected to the site
www.b.co.uk
www.c.co.uk
www.d.co.uk

How can I access page1 typing the address www.b.com and have the browser url bar display www.a.co.uk/THISISPAGE1 if possible.

I have written
Code:
RewriteCond %{HTTP_HOST} ^www\.b\.com$ [NC]
RewriteRule http://www.a.co.uk/folder1/page1 http://www.a.co.uk/THISISPAGE1 [R=301,L]


The redirect seems to work but the content is not being displayed.

Thanks
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 26 Feb '13 12:29    Post subject: Reply with quote

Do you see the new URL in your browser?
Back to top
quali74



Joined: 13 Oct 2006
Posts: 2

PostPosted: Tue 26 Feb '13 13:09    Post subject: Reply with quote

solution:

Code:
RewriteCond %{HTTP_HOST} ^(www\.)?b\.com$ [NC]
RewriteRule .* https://a.co.uk/THISPAGE1 [R=301,L]

RewriteRule ^THISPAGE1$ /index.php?param1=folder1&param2=folder2&pagename=page [L]
[/quote]
Back to top


Reply to topic   Topic: htaccess internal redirect View previous topic :: View next topic
Post new topic   Forum Index -> Apache