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: Redirect and rewrite rules
Author
simonh



Joined: 15 Jan 2016
Posts: 1
Location: England, Birmingham

PostPosted: Fri 15 Jan '16 17:04    Post subject: Redirect and rewrite rules Reply with quote

Code:
<IfModule mod_authz_host.c>
Order allow,deny
Allow from all
Deny from env=BlockOfflineCopying
</IfModule>
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --

RewriteEngine On
RewriteCond %{HTTP_HOST} ^hostname\.co.uk [NC]
RewriteRule (.*) http://www.hostname.co.uk/$1 [L,R=301]

Redirect 301 /about-us/ http://www.newhostname.co.uk/ourfirm/aboutourfirm/ourfirm.aspx


Hi would be grateful for any help. 'About us' redirect works as expected.

When I add this:
Code:
Redirect 301 /about-us/our-team/ http://www.newhostname.co.uk/ourfirm/contacts/ourpeople.aspx


The url hostname.co.uk/about-us/our-team/ redirects to http://www.newhostname.co.uk/ourfirm/aboutourfirm/ourfirm.aspx/our-team

but I want it to go to http://www.newhostname.co.uk/ourfirm/contacts/ourpeople.aspx

I think this is to do with the rewrite conditions?

Help! Searched long and hard for this, but can't find anything.

Thanks
Simon
Back to top
James Blond
Moderator


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

PostPosted: Sat 16 Jan '16 18:15    Post subject: Reply with quote

You need to change the redirect to a rewrite rule with a L before the other rules.
Back to top


Reply to topic   Topic: Redirect and rewrite rules View previous topic :: View next topic
Post new topic   Forum Index -> Apache