Page 1 of 1

.htaccess rewrite rule problem

Posted: Wed Apr 28, 2010 9:47 am
by gurjit
Hi

I have a rewrite rule as such

Options +FollowSymLinks
RewriteEngine on
RewriteBase /

RewriteRule ^about/our-team.html$ http://www.mydomain.co.uk/our-team.php [L]


I have created a link in my menu bar

http://www.mydomain.co.uk/about/our-team.html

Whats happening is that the correct page gets called which is http://www.mydomain.co.uk/our-team.php

but

the browser window shows link http://www.mydomain.co.uk/our-team.php

and not

http://www.mydomain.co.uk/about/our-team.html

so the friendly url is not getting displayed in the browser address bar.

why would this happen. It was all working fine and then my hosting company put me on a new server. They tell me its my htaccess but it worked on the old server for the last 8 months.

anyone had this problem?

Re: .htaccess rewrite rule problem

Posted: Sat May 01, 2010 2:53 am
by JakeJ
Could you possibly have another .htaccess in your directory structure that is overriding the one you think should be proving the friendly URL?

Re: .htaccess rewrite rule problem

Posted: Sat May 01, 2010 3:20 am
by requinix

Code: Select all

RewriteRule ^about/our-team.html$ http://www.mydomain.co.uk/our-team.php  [L]
Including the http://... tells Apache that it should not do the redirect internally and should redirect the browser instead.