• Home
  • Get help
  • Ask a question
Last post 20 hours 37 min ago
Posts last week 81
Average response time last week 4 hours 29 min
All time posts 67915
All time tickets 10498
All time avg. posts per day 20

Helpdesk is open from Monday through Friday CET

Please create an (free) account to post any question in the support area.
Please check the development versions area. Look at the changelog, maybe your specific problem has been resolved already!
All tickets are private and they cannot be viewed by anyone. We have made public only a few tickets that we found helpful, after removing private information from them.

#27 – bulk redirect of old URLs using regex

Posted in ‘sh404SEF’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Wednesday, 08 April 2015 15:51 UTC
waltcooley
 We've installed sh404SEF and got it configured; however, we need to redirect a LOT (over 3000+) old URLs to their new SEF URL.

Like this:
OLD URL:
topics/management/6708-control-burrowing-rodents-to-help-safety-reduce-forage-loss
NEW URL:
/topics/management/control-burrowing-rodents-to-help-safety-reduce-forage-loss

I have tried creating .htaccess rules like this:
RewriteRule ^topics/([-0-9a-zA-Z]+)?/([0-9]+)?-(-[a-zA-Z]+)? http://xxxx.net/topics/$1/$3 [L,R=301]

But I always get a 404 error.

I've tried using 3rd party extensions
(like http://extensions.joomla.org/extensions/extension/site-management/url-redirection/massive-redirects) but still get same 404 error.

I've checked with my server/hosting company support (SiteGround) and they don't see a problem with the htaccess rule (and we've tried several different syntax options).

Can you tell me if there is ANY way within sh404SEF to create these rules or IF sh404sef might be blocking the redirect at any level?
Wednesday, 08 April 2015 15:57 UTC
wb_weeblr
Hi

If the (target) urls already exists (ie if you can access them by typing them directly in the browser address bar, then no, sh404SEF won't interfere with this.
If the target URLs are not in the URL database, then yes, a 404 will be triggered.

That's easily tested on a single URL. Can you give me one sample pair: old url, new url?

I'd totally recommend going the .htaccess way if possible, that's definitely the most efficient way.
sh404SEF itself don't have any provision for regex-based redirects, we're more working with individual urls (thought that's certainly a good feature for advanced users)

Rgds
 
Wednesday, 08 April 2015 16:24 UTC
waltcooley
Sorry I didn't give you the full URL.

Here is the 'old' URL:
http://xxxx.net/topics/management/6708-control-burrowing-rodents-to-help-safety-reduce-forage-loss


Here is the 'new' (sh404sef) URL:
http://xxxx.net/topics/management/control-burrowing-rodents-to-help-safety-reduce-forage-loss


As you can see, the new/sh404sef URL does work properly.
It's just very strange that the regex rules don't work.

It's like the htaccess rules are being ignored.

Any ideas?


Wednesday, 08 April 2015 16:39 UTC
wb_weeblr
Well it's not that you get a 404, the problem is that the htaccess rule is not triggered at all. So no redirect happens (the url doesn't change in the browser bar).

ok, was doing some testing,but it seems to work now?
 
Wednesday, 08 April 2015 16:58 UTC
waltcooley
That is VERY strange.
It's working for me now also.

I'm guessing that my hosting company (who told me that you can't redirect SEF urls) decided to make changes to the htaccess file (without my approval) [I'm close to posting a bad review about this hosting company.]

I'll update this when I track down exactly why it is now working.
Wednesday, 08 April 2015 21:36 UTC
waltcooley
Yes, it was my hosting company.
They were able to track down a syntax compatibility issue with the regex rule.
We've almost got it working - can't wait to actually put sh404sef to work.

BTW ... congratulations on the move back to managing the project directly. I'm looking forward to seeing great things from weeblr. And will post a good review for your support on this issue!

Thanks!
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.