Forum Moderators: phranque

Message Too Old, No Replies

url redirect problem

         

fzx5v0

7:59 pm on Apr 16, 2008 (gmt 0)

10+ Year Member



hi I would like to redirect some urls but I am having problems

iwould like to redirect

[mydomain.co.uk...]

to

[mydomain.co.uk...]

I have hundreds of url redirects to do with different image names at the end

I tried this but it doesnot work
RewriteRule ^/index\.php/cPath/images/([^/]+) [mydomain.co.uk...] [R=301,L]

can anyone point me in the right direction

jdMorgan

10:27 pm on Apr 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where did you put this code?
Do you have any other working rewriterules?

Jim

g1smd

11:33 pm on Apr 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it a redirect that you want, or a rewrite?

Which URL appears in the links on the HTML page?

Where in the server filesystem is the file actually located?

fzx5v0

9:24 am on Apr 17, 2008 (gmt 0)

10+ Year Member



Hi
I put this in the .htaccess the problem is that when google caches the page it caches the image url's as [mydomain.co.uk...]

when the proper url is
[mydomain.co.uk...]

so in the cached page the images are not displayed but when a user looks at the site the images are there

so I do not understand why it is hapening so I am going to redirect that url so google see the images.

In yahoo msn ect they see the images fine

thanks

g1smd

9:54 am on Apr 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it a redirect that you want, or a rewrite?

Which URL appears in the links on the HTML page?

Where in the server filesystem is the file actually located?

fzx5v0

11:53 am on Apr 17, 2008 (gmt 0)

10+ Year Member



on the server the file sites

/images/easyinkz1a.gif in the html it is index.php/cPath/images/easyinkz1a.gif

thanks

jdMorgan

1:54 pm on Apr 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the .htaccess context, the path to the current directory is removed. So the URL-path "seen" by RewriteRule will not include the leading slash. Try:

RewriteRule [b]^in[/b]dex\.php/cPath/images/([^/]+)$ http://www.example.co.uk/images/$1 [R=301,L]

[added] You should also fix the links on your pages to point to the proper URLs. [/added]

Jim

[edited by: jdMorgan at 2:00 pm (utc) on April 17, 2008]