Forum Moderators: phranque

Message Too Old, No Replies

Joomla Migration and url rewriting

         

Surcoufy

11:52 am on Aug 5, 2010 (gmt 0)

10+ Year Member



Hello
Despite his four years of good service, I decided to abandon my old phpnuke to adopt joomla.

However I have one last reluctance to take the leap: I might lose the achievements of four years of web presence and SEO ...

I had the feeling of finding a solution with the url rewriting, but my .htaccess does not give me the results I'm waiting for.

I would like those people going to the following address (http://www.encyclopirate.com/modules.php?name=Content&pa=showpage&pid=22) is automatically redirected to the new address (http://joomla.encyclopirate.com/index.php?option=com_content&view=article&id=3&Itemid=5), once the joomla site has replaced the phpnuke one.
Of course the subdomain "joomla" will be replaced by "www".

Here's my test to match a previous address nuke with the new joomla page on:



Options +FollowSymlinks

# Iwant "http://www.encyclopirate.com/modules.php?name=Content&pa=showpage&pid=22" redirect to "http://www.encyclopirate.com/index.php?option=com_content&view=article&id=3&Itemid=5"


RewriteRule ^modules.php?name=Content&pa=showpage&pid=22 /index.php?option=com_content&view=article&id=3&Itemid=5 [R=301,L]





I hope you can solve my problem because I can hardly say I'll lose my place on search engines...

g1smd

12:51 pm on Aug 5, 2010 (gmt 0)

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



RewriteRule cannot see the appended query string data.

Use a preceding RewriteCond testing QUERY_STRING for that.

The redirect target should include protocol and domain name.

Those Joomla URLs are unwieldy. Look at URL rewriting to present something more friendly to your visitors.

www.example.com/article-3-5
is a lot more usable than
www.example.com/index.php?option=com_content&view=article&id=3&Itemid=5

Surcoufy

4:42 pm on Aug 6, 2010 (gmt 0)

10+ Year Member



Found a solution on [developpez.net...]


Options +FollowSymlinks
RewriteCond %{QUERY_STRING} =name=Content&pa=showpage&pid=22
RewriteRule ^modules\.php$ /index.php?option=com_content&view=article&id=3&Itemid=5 [R=permanent,L]


Thank you for your help


I have another problem :
In my old site, pictures were at the root of my site in directories /jpg /bmp /gif /swf ...
By migrating to joomla, my images are now stored in another way : images/stories/jpg, images/stories/bmp, images/stories/gif, images/stories/swf...

How to redirect the images in the folder /folder1 to folder images/stories/dossier1 /?

g1smd

5:37 pm on Aug 6, 2010 (gmt 0)

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



You didn't action some of the stuff I gave in my previous answer.

Your new 'images' rule needs a single line of code, and can be based on the earlier redirect code above.

Surcoufy

7:26 pm on Aug 6, 2010 (gmt 0)

10+ Year Member



Here is the code I use to solve my problem :

RewriteRule ^(?:jpg|bmp|gif|swf)/ /images/stories%{REQUEST_URI} [R=permanent,L]

g1smd

8:49 pm on Aug 6, 2010 (gmt 0)

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



Are you sure your image URLs have a trailing slash? That's what you have coded here. And the colon? Why?

You're still missing another crucial piece in the puzzle.

The redirect target should include protocol and domain name.