• 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

#1
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?
 

Jake Bunce

XenForo moderator
Staff member
#2
For what purpose? This seems a strange thing to do. If you tell me what for then I can help with a solution.
 
#3
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
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?

like

^ members|links|avatar|api .*$ newindex.php
 

Jake Bunce

XenForo moderator
Staff member
#5
Code:
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.
 
#6
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:()