1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 How to redirect an URL in wordpress format

Discussion in 'XenForo Questions and Support' started by Embeddedfoo, Aug 10, 2016.

  1. Embeddedfoo

    Embeddedfoo Member

    I have shut down a wordpress site and migrated all important content to xenforo threads. I have also redirected all original wordpress traffic to the forums. Unfortunately, there are still a few documents and mobile apps in the field that have outdated links of the form

    /index.php?page_id=nnn​

    I would like to capture and redirect those couple of pages to new URLs located on the xenforo server. Route Filters *almost* do it but they insist that the find route start with a route prefix e.g. thread or forum. Is there a way to do this with Route Filters? Another way within xenforo?

    I also tried and failed to redirect using Alias and AliasMatch in the apache config file. Couldn't make it work with anything in the "index.php?blahblah" form.

    Thanks for any tips.
     
  2. Mr Lucky

    Mr Lucky Well-Known Member

    .htaccess

    You cannot use a standard 301 due to the query string, but this should work to redirect index.php?blahblah

    Code:
    RewriteCond   %{REQUEST_URI}    ^/index.php$
    RewriteCond   %{QUERY_STRING}   ^blahblah$
    RewriteRule   ^(.*)$ http://yourforum.com/newURL/   [R=301,L]
     
  3. Embeddedfoo

    Embeddedfoo Member

    Thanks for the tip, but still no joy. I tried it in .htaccess and the server config. Also verified that mod_rewrite is included. Also increased LogLevel to info but didn't see any rewrite entries in error.log.
     
  4. Mr Lucky

    Mr Lucky Well-Known Member

    Last edited: Aug 10, 2016
  5. Embeddedfoo

    Embeddedfoo Member

    I tried a few more variations using RewriteCond but still had no luck. I'll have to leave it as is for now. References to the broken links end up on the default forum page, which is not horrible. I'll have an opportunity to change the broken links in the mobile app within the next month. We have a more permanent URL for the documents that it refers to in any case, and I'm not sure who goofed (maybe me) letting the "index.php?page_id=" form get out in the wild.

    Thank you for your help.
     

Share This Page