We moved from asp .net to wordpress in the month of February, however we still see url's tagged with .aspx and these url's are going 404.

Harsha Kulkarni
Harsha Kulkarni used Ask the Experts™
on
Sample URL's

 /book_tour.aspx?year=2017&tourcode=8240&strdate=18/Jul/2017&endDate=28/Jul/2017&strdept=824070718Z
/book_tour.aspx?year=2017&tourcode=9020&strdate=25/Feb/2017&endDate=05/Mar/2017&strdept=902070225

Our site is a dynamic site where data is pulled through API.

I'm not sure if something has to be tweaked in wordpress or htaccess file. Also another biggest issue is, our organic traffic has dropped 80%, I understand that initially when platform changes, there will be a traffic drop but it's not improving month on month. Did we do something wrong in migration, I'm not sure, Please help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Check the inspect [Ctrl+Shift+i] in chrome and ask developers to fix 404 errors.

Author

Commented:
Thanks for your solution Pushpakumara. Im fixing 404 by re-directing using a WP plugin and also marking them in Google Webmaster console. Till now, I've redirected 800+ urls and still these URL's are getting generated on a daily basis. Im not able to pin point the source of the problem.
Is there any page crashes in your web site?
It seems you notice request for .aspx and 404 response in google analytics.
Have you use java script menu in your aspx website?
I guess you have already did,  Settings » Permalinks, and simply click on Save.
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Author

Commented:
Is there any page crashes in your web site? - rarely but it happens
It seems you notice request for .aspx and 404 response in google analytics. - Not in GA but in Google Webmaster Console
Have you use java script menu in your aspx website? - Yes
I guess you have already did,  Settings » Permalinks, and simply click on Save. - yes

Author

Commented:
We are already using a 301 redirect plugin and majority of the urls are redirected to homepage, however ever some urls need to redirected to relevant pages.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
If you have 800 broken URLs, best to fix them en-mass on the command line, using https://wp-cli.org, this is a one line command...

Let's say your old link was /book_tour.aspx + your new link is /book-tour-info, then you'd change all occurrences in your database, via...

wp search-replace "/book_tour.aspx"' "/book-tour-info" --all-tables --precise --recurse-objects --dry-run

Open in new window


Use --dry-run to get an idea of how many links will be changed, then remove --dry-run to make the changes.

I use this type of command every day, fixing various client problems. It's worked correctly every time I've used it + be sure you backup your database first, just in case you have to revert to old data.

Author

Commented:
Hello David. Thanks for your solution.

However the issue what im having is bit tricky.
Let me explain more in detail.

These url's are not ending with .aspx, infact these are dynamic URL's based on booking date, tour code, iterinary etc. Below are some URL's

https://www.domainname.in/book_tour.aspx?year=2017&tourcode=8940&strdate=13/Jun/2017&endDate=28/Jun/2017&strdept=894070613Z
https://www.domainname.in/book_tour.aspx?year=2017&tourcode=6660&strdate=01/Jul/2017&endDate=15/Jul/2017&strdept=666070701
https://www.domainname.in/book_tour.aspx?year=2017&tourcode=8530&strdate=29/Jul/2017&endDate=13/Aug/2017&strdept=853070729Z
https://www.domainname.in/book_tour.aspx?year=2017&tourcode=5291&strdate=12/Jul/2017&endDate=09/Aug/2017&strdept=529170710

Initially I saw 2010, 2011,2013, 2016 year URL's and I thought it could old URL's then past one week, I started seeing these URL's in crawl error section of webmaster tools. Im not able to figure out how these URL's are getting generated with .aspx when the . net site was closed 8 months back. Another thing is, currently we have 2 tabs for tour listing, as 2017 is ending, from 2018 we will not show 2017 tab, hopefully again that will not cause any issues.

Is there any setting that we are missing in WP. Please let me know if you need anything in specific details. Please advise.
Fractional CTO
Distinguished Expert 2018
Commented:
You have two items to fix.

1) Rewrite all your database links, using the technique I mentioned above.

Only use wp-cli for this. Do not, use one of the many search + replace tools/plugins, as they incorrectly write links + you can end up with your database so corrupted, you'll have to do a database restore.

2) Add in a set of redirects to your .htaccess file of the form...

RewriteRule ^old-link$    https://foo.com/new-link [R=302,NC,L]

Open in new window


Which will handle passing traffic from old links to new links. When you're sure a link is redirecting correctly, change 302 to 301 to pass SEO juice from old link to new link.

If you don't have to pass SEO juice, leave as 302s, because 301s cause massive problems if you ever may a mistake... because... 301s are cached in some browsers (Chrome) forever, so once you set a 301, no one who visits the old link will ever see any change you make to new link part of the redirect.

Author

Commented:
Thanks a lot for your insights David, looks like thats what i've to do.

Author

Commented:
Thanks a lot for your insights David, looks like thats what i've to do.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
You're welcome.

Glad you're able to resolve your issue.
Bryr de GraySEO Technician

Commented:
You need to work on the 301 redirection of this pages including the dynamic pages that are currently indexed in Google or are being shared on external sites. Double check with your host and you can ask them to help you out the redirection.

You can install a broken link checker plugin in Wordpress to check on broken links in your site.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial