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

Force a certain style temporarily via URL

Chris D

XenForo developer
Staff member
#1
Let me try to explain this without confusing the hell out of people.

So, XenPorta and the built in "Pages" feature both contain an option to force a different style for everyone who visits those pages.

What if you wanted to only show a different style sometimes (such as if the content is being accessed via an iFrame or similar)?

What I'm talking about is people visiting the page normally access it via its URL, for example: http://www.valvetime.net/pages/Staff/

But would it be possible to force a different style simply by changing the URL. for example http://www.valvetime.net/pages/Staff/?style_id=2?

Is this possible as it is, or would I need to be looking for an add-on?
 

Chris D

XenForo developer
Staff member
#4
Both of you are geniuses.

I searched incredibly hard for an add on such as these two... Clearly not hard enough!

Thank you!
 

0xym0r0n

Well-known member
#5
my domains just keep redirecting to my main domain and showing the default style. This is on firefox, chrome, mobile, and IPAD...

But I was also have issues with my domains redirecting before this... I guess XF forces a redirect already but I don't see where I'd adjust that in my .htaccess as I've already written exceptions...

setup as domainexample.us
http:// www. reddead . us /forum /31/

Set for all users and wildcard everything else
 

Jake Bunce

XenForo moderator
Staff member
#6
my domains just keep redirecting to my main domain and showing the default style. This is on firefox, chrome, mobile, and IPAD...

But I was also have issues with my domains redirecting before this... I guess XF forces a redirect already but I don't see where I'd adjust that in my .htaccess as I've already written exceptions...

setup as domainexample.us
http:// www. reddead . us /forum /31/

Set for all users and wildcard everything else
You want to change the style_id too? Based on what condition? You posted a forum URL... you can edit individual forums in the Admin CP and set a custom style.
 

alexD

Well-known member
#7
my domains just keep redirecting to my main domain and showing the default style. This is on firefox, chrome, mobile, and IPAD...

But I was also have issues with my domains redirecting before this... I guess XF forces a redirect already but I don't see where I'd adjust that in my .htaccess as I've already written exceptions...

setup as domainexample.us
http:// www. reddead . us /forum /31/

Set for all users and wildcard everything else
It appears you're referring to my add-on.

Create some new rules and play only with the URI sub-rules. Test the following ones:
post_in_the_add-on_discussion_next_time.png

Here is the support thread. There was another user with a similar redirection problem, you may look it up.