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.

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.
Harsha KulkarniAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Pushpakumara MahagamageVPCommented:
Check the inspect [Ctrl+Shift+i] in chrome and ask developers to fix 404 errors.
Harsha KulkarniAuthor 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.
Pushpakumara MahagamageVPCommented:
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.
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Harsha KulkarniAuthor 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
Pushpakumara MahagamageVPCommented:
Read following article

http://www.wpbeginner.com/showcase/6-best-free-404-plugins-for-wordpress/

try all 404 Redirect to Homepage
Harsha KulkarniAuthor 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 FavorLinux/LXD/WordPress/Hosting SavantCommented:
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.
Harsha KulkarniAuthor 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.
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Harsha KulkarniAuthor Commented:
Thanks a lot for your insights David, looks like thats what i've to do.
Harsha KulkarniAuthor Commented:
Thanks a lot for your insights David, looks like thats what i've to do.
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
You're welcome.

Glad you're able to resolve your issue.
Bryr de GraySEO TechnicianCommented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Search Engine Optimization (SEO)

From novice to tech pro — start learning today.