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

XF 1.4 redirect all website to one page htaccess 301

Discussion in 'Troubleshooting and Problems' started by jamalfree, Jun 27, 2016.

  1. jamalfree

    jamalfree Active Member

    redirect all website to one page htaccess 301

    i use this but didn't work perfectly


    HTML:
    
    RewriteRule ^(.*)$  http://www.example.com/ [R=301,L]
    
    
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Need more info... but if that rule is in the web root (same as the redirect target) then it will cause infinite redirection. Try this to avoid that:

    Code:
    RewriteRule ^$ - [S=1]
    RewriteRule ^(.*)$  http://www.example.com/ [R=301,L]
    
     
    jamalfree likes this.
  3. jamalfree

    jamalfree Active Member

    Last edited: Jun 27, 2016
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Oh

    Code:
    RewriteRule ^(.*)$  http://www.example.com/? [R=301,L]
    
    The "?" will empty the query string on redirect.
     
    jamalfree likes this.
  5. jamalfree

    jamalfree Active Member

    very nice
    thanks jack..................
     

Share This Page