I would like to get a redirect match most of the time. I'm currently working on moving a Joomla site to Drupal; Joomla uses a lot of query parameters. In order to match the redirect at a higher rate I would like to normalize the query string.

CommentFileSizeAuthor
#1 path_redirect-938704.patch779 bytesmikeytown2

Comments

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new779 bytes
dave reid’s picture

I don't get why this is needed? Can you provide examples of URLs where this makes a difference or explain in a little more detail?

mikeytown2’s picture

chromix’s picture

#1: path_redirect-938704.patch queued for re-testing.

chromix’s picture

I would also like to use this patch, as I'm also transitioning from another CMS that uses query strings in all of it's URLs, similar to how Drupal looks before safe URLs are turned on.

mikeytown2’s picture

can you test the patch and report back that it works?

satcom74’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc2
Category: feature » support

I am also transitioning from a Joomla site to a Drupal site and I'm needing to redirect the query string urls to the new clean urls.

For instance, index.php?Itemid=340&id=184&option=com_content&task=view to redirect to pages/dining

I tried the patch and it didn't seem to make a difference. It's redirecting to my homepage each time.

mikeytown2’s picture

Version: 6.x-1.0-rc2 » 6.x-1.x-dev
Category: support » feature
YK85’s picture

subscribing

datarazor’s picture

patch doesn't help me either.
need to redirect based on id= or itemid= from Joomla to a clean URL in Drupal.

subscribing: +1

mikeytown2’s picture

Need this patch (#1) along with this one
#938640-1: Smarter index.php in uri handling

I think I directly injected the redirects into the database; we had over a thousand to keep track of. Hope that helps you get this working on your site.

datarazor’s picture

Hi Mikey town, didn't see your repsonce before I fixed it myself... so if your solution works, awesom!

Here is what i did to make a "working" solution, a semi-manual process:

in the htaccess file I added for each old link:

RewriteCond %{QUERY_STRING} Itemid=195
RewriteRule ^(.*)$ http://chedal.org/index.php?q=blog/gift-economy-viable-economy [R=301,L] 

The key is that Joomla links have to be checked for as UN-clean, and then redirected to UN-clean Drupal links.

Once I did this, everything works fine. The page redirects to the unclean Drupal site but htaccess rapidly [un-perceptively] corrects the URL to be a clean one after redirection.

The only pain here is that I needed to do some additional search-replace to change my CSV file to match this output. But once I did that I was able to script in my 50 needed lines [for the top 50 visited pages] to ensure a smooth redirection.

I hope this tip will help others!