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

XF 1.1 Customize Rewrite Rules

Discussion in 'Troubleshooting and Problems' started by havanaclub, Feb 1, 2013.

  1. havanaclub

    havanaclub Member

    How can i redirect some custom route prefixes to my new newindex.php file when full url rewrite is enabled?
    What have i to change in the xenforo htaccess file?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    For what purpose? This seems a strange thing to do. If you tell me what for then I can help with a solution.
  3. havanaclub

    havanaclub Member

    Because i want to use my own frontcontroller.

    Instead of using the event system and hack around with all the dependencies (request, response, xenforo router, etc...), i prefer to use my own entrypoint.

    So all i want to do via htaccess is

    if url is:

    foobar.com/members => use newindex.php instead of index.php
    foobar.com/baz => use newindex.php instead of index.php
    foobar.com/bazinga => use newindex.php instead of index.php
    everthing else should use the standard xenforo rewrite rules
  4. havanaclub

    havanaclub Member

    This is working

    RewriteRule ^members.*$ newindex.php [NC,L]

    but I would prefer 1 line for everything instead of 1 line for each route prefix

    Is there a way to do this?


    ^ members|links|avatar|api .*$ newindex.php
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    RewriteRule ^(members|links|avatar|api).*$ newindex.php [NC,L]
    edit - but I still recommend using XenForo's addon system for this. Create a route and a route handler, and a controller.
    havanaclub likes this.
  6. havanaclub

    havanaclub Member

    It's not possible, because i'm moving to symfony2 full stack framework, which can't handle the zend framework components(which are hardcoded in xenforo:()

Share This Page