• Hello, I have struggled with this for days.

    The main issue here is that Google search/crawl and Facebook drop the parameters and do a 301 redirect to the main page aka the permalink.

    What we have done is integrated an external angular application using wordpress templates to view the data. These parameters query an external source to view specific data but wordpress knows nothing about them so when we crawl the link or try to share the page it redirects to the main page.

    I have googled and tried about everything. I have removed the redirect canonical. I have updated the canonical url and the og:url in the functions.php file to be the full url but wordpress seems to be taken over.

    We have tried playing with the htaccess file.

    ex. http://www.example.com/person?personName=scott
    gets 301 redirect to http://www.example.com/person which is a blank page.

    Running similar pages outside of WordPress work with no issues as we have integrated this system into non WordPress sites.

    Does anyone have any ideas?
    Has any one even done this before?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator bcworkz

    (@bcworkz)

    Have you tried this variant with a trailing slash:
    example.com/person/?personName=scott

    Thread Starter smackayht

    (@smackayht)

    No I have not tried that.
    I will try and set that up and see how it goes.

    Thread Starter smackayht

    (@smackayht)

    Ok I have tried this and still the same issue.

    I wish there was an update permalink command.

    Moderator bcworkz

    (@bcworkz)

    You should keep the trailing slash anyway, it’s lack does cause another redirect (302).

    There is a way to accommodate custom permalinks, the Rewrite API. However, I believe URL parameters are already stripped by the time these take effect. BUT, if your permalink contained the parameter in its “path”, a rewrite rule is a great way to extract that parameter from the permalink and place it as an URL parameter. If your permalink were example.com/person/scott/, a rewrite rule can convert that to example.com/path/person.php?personName=scott.

    Maybe that will help?

    Thread Starter smackayht

    (@smackayht)

    @bcworkz

    I have some updates today.

    I did not mention I was using this process on a multisite install.
    Today I installed a single site install and everything works as expected. The links are not redirecting and Google and Facebook can crawl.

    This leads me to believe a multisite install has an issue with this.

    Any thoughts?

    Moderator bcworkz

    (@bcworkz)

    There’s apparently something unusual about your installation. My multisite testbed, which is very much plain vanilla, does not exhibit this behavior. (provided the URL has a trailing slash) I requested a normal WP page, though it could have easily been a page with a custom template that executes some elaborate code. There were no redirects and my unregistered URL parameters persisted and were available in $_GET.

    Have you checked your .htaccess file for rewrites beyond the default WP rules? Some types of rewrites are known to drop URL parameters.

    Thread Starter smackayht

    (@smackayht)

    @bcworkz

    We have finally resolved this issue. Our host had a setting called redirect bot turned on for multisite which caused the redirects.

    Once we saw that a single site was working fine they corrected our multisite installs.

    Thanks for all you assistance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress with Angularjs 301 redirects issue with parameters’ is closed to new replies.