Viewing 1 replies (of 1 total)
  • Thread Starter mikblik

    (@mikblik)

    In case anyone else has this problem, the solution is very simple. You just need to add a few lines of code to your “.htaccess” file.

    My redirects are setup to redirect all “mihaelblikshteyn.com” and “www.mihaelblikshteyn.com” traffic to my SmugMug account at “archive.mihaelblikshteyn.com”. This messed with WordPress search as WordPress tried to display search results as “mihaelblikshteyn.com/?s=search-term” and the redirect would take it to SmugMug. With the below code, WordPress search results are forced to be displayed as “www.mihaelblikshteyn.com/search/search-term”.

    # search redirect
    # this will take anything in the query string, minus any extraneous values, and turn them into a clean working url
    RewriteCond %{QUERY_STRING} \\?s=([^&]+) [NC]
    RewriteRule ^$ https://www.mihaelblikshteyn.com/search/%1/? [NC,R,L]
Viewing 1 replies (of 1 total)
  • The topic ‘Search results problem from DNS redirection’ is closed to new replies.