Apache RedirectCond/RedirectWrite Help

amariotti's picture

I am nearing the completion of converting an Accrisoft CMS site to Drupal and have one last piece that is not working.

Accrisoft's URL generation is like other CMSs, clunky, but since the site has been around for so long the URLs have gained good reputation on Google, Bing, Yahoo, etc. Normally this really wouldn't be a big deal, but for this certain case it really has been.

Here's what I have to work with:
OLD URL: http://d.proimage.net/index.php?src=gendocs&ref=STORELOCATOR&category=Main
NEW URL: http://d.proimage.net/franchise-locator

And here's what's NOT working (sends me to the home page):

RewriteCond %{HTTP_HOST} d.proimage.net
RewriteCond %{REQUEST_URI} ^/index.php\?src=gendocs\&ref=STORELOCATOR\&category=Main$
RewriteRule . http://d.proimage.net/franchise-locator [L,R=301]

Anyone out there have any new ideas to try? I have to get this working...for SEO purposes...so I'm reaching out for any help or tips on what to do here. Thanks.

Login or register to post comments

shot in the dark

mikeytown2's picture
mikeytown2 - Tue, 2010-08-10 17:55

shot in the dark

RewriteRule index.php\?src=gendocs\&ref=STORELOCATOR\&category=Main  franchise-locator [L,R=301]

One more to try

RewriteCond %{HTTP_HOST} d.proimage.net
RewriteCond %{REQUEST_URI} index.php
RewriteCond %{QUERY_STRING} src=gendocs\&ref=STORELOCATOR\&category=Main
RewriteRule . http://d.proimage.net/franchise-locator [L,R=301]


Wow. I really feel stupid. I

amariotti's picture
amariotti - Tue, 2010-08-10 18:07

Wow. I really feel stupid. I tried everything I could with the RewriteRule and couldn't get anything to work. Anything that worked would break the entire Drupal site (images, etc.) The first one you put up worked! I should've come here first. :)

While it works, it just changes the index.php to franchise-locator, which is fine. But is there any way to fix that? Here's what it forwards me to:
http://d.proimage.net/franchise-locator?src=gendocs&ref=STORELOCATOR&category=Main

Andrew (amariotti)


strange

mikeytown2's picture
mikeytown2 - Tue, 2010-08-10 18:52

In the rules for the first one I didn't specify QSA (query string append)

What about the second one?

RewriteCond %{HTTP_HOST} d.proimage.net
RewriteCond %{REQUEST_URI} index.php
RewriteCond %{QUERY_STRING} src=gendocs\&ref=STORELOCATOR\&category=Main
RewriteRule .* http://d.proimage.net/franchise-locator [L,R=301]


I get the following error

amariotti's picture
amariotti - Wed, 2010-08-11 15:38

I get the following error from Firefox when using that one:
The page isn't redirecting properly

Andrew (amariotti)


I'm really frustrated now. I

amariotti's picture
amariotti - Wed, 2010-08-11 15:44

I'm really frustrated now. I had it working temporarily and I can't get it back to where it was doing what I mentioned above. Really frustrating. This thing has been a real pain.

Andrew (amariotti)


Strange. For some reason it's

amariotti's picture
amariotti - Tue, 2010-08-10 18:23

Strange. For some reason it's not working anymore. Not sure what really happened...Trying to replicate it and it's not working. Ugh. :(

Andrew (amariotti)


If you want to use the Path

Dave Reid's picture
Dave Reid - Wed, 2010-08-11 19:52

If you want to use the Path redirect module for this you can create a redirect:
From: <front>?src=gendocs&ref=STORELOCATOR&category=Main
To: franchise-locator


Awesome! I was hoping that

amariotti's picture
amariotti - Wed, 2010-08-11 20:37

Awesome! I was hoping that Path Redirect module could do the trick, but just something wasn't working for me. That was it! Thanks a million!

Cheers!

Andrew (amariotti)