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

XF 1.3 Rewriting query url to SEO friendly url

1BJK903

Active member
#1
Is this possible? I want the recent posts to be my homepage, so I have to use the URL with the query.

The recent posts URL is this: http://domainname.com/subfolder/?find-new/posts&recent=1

What I want is: http://domainname.com/ + maintaining the querying page.

What I did:
RewriteEngine On
RewriteBase /subfolder/

RewriteCond %{THE_REQUEST} /\?find-new/posts&recent=1\s [NC]
RewriteRule ^$ /subfolder/? [L,R=301]

RewriteCond %{QUERY_STRING} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^$ ?$1?find-new/posts&recent=1 [L,NC,QSA]


Result? It redirects me to http://domainname.com BUT, it does not query and it is not the right page. It shows me the forum page instead of the recent posts.

Is there a workaround for this?
 

Jake Bunce

XenForo moderator
Staff member
#3
I have been unable to get this working.

A redirect is certainly doable, but you want to abstract the URL.

One option is to create a small addon. That would give you the control you need. This requires some coding ability though.
 

1BJK903

Active member
#4
I have been unable to get this working.

A redirect is certainly doable, but you want to abstract the URL.

One option is to create a small addon. That would give you the control you need. This requires some coding ability though.
Thanks for trying to help me. Well, could you send me to the right direction? How would I start? I thought of making the homepage static by using find_new_posts as template and converting it to HTML but I could not get that working. How would I make an add-on?