Welcome Guest, Not a member yet? Register   Sign In
htaccess problems with 301 and ?
#1

[eluser]Scott Boyde[/eluser]
recently I had to move hosts and the with the new host I had to add ? into the line that removed the index.php

So my this line

Code:
RewriteRule ^(.*)$ /index.php/$1 [L]

Became

Code:
RewriteRule ^(.*)$ /index.php?/$1 [L]

My 301 redirect rule is

Code:
redirect 301 /pages/home.html http://www.nifootball.co.uk

But when you visit that page you just get a url with a ? where the index would normally be

http://www.nifootball.co.uk/?/pages/home.html
#2

[eluser]farinspace[/eluser]
what happens when you don't have the "?" in the rewrite rule?
#3

[eluser]Scott Boyde[/eluser]
I get page not found for all my pages.
#4

[eluser]Maglok[/eluser]
Yeah I know the ?.

You should make the redirect the last rule executed or htaccess will grab the now new url and feed it to index.php.

Code:
redirect 301 /pages/home.html http://www.nifootball.co.uk [L]
That should give you something.
#5

[eluser]Scott Boyde[/eluser]
[quote author="Maglok" date="1269359280"]Yeah I know the ?.

You should make the redirect the last rule executed or htaccess will grab the now new url and feed it to index.php.

Code:
redirect 301 /pages/home.html http://www.nifootball.co.uk [L]
That should give you something.[/quote]

I get an internal server error when I put that last.
#6

[eluser]Maglok[/eluser]
Was worth a shot. Oh how I loath htaccess at times.

Mabye you can rewrite around it temporarily. RewriteRule it?

Shame the [L] didn't work.




Theme © iAndrew 2016 - Forum software by © MyBB