# Edited htaccess and now im getting discourse sso expired error

**URL:** https://meta.discourse.org/t/edited-htaccess-and-now-im-getting-discourse-sso-expired-error/86848
**Category:** WordPress
**Created:** [5월 5, 2018, 8:43오후 UTC](https://meta.discourse.org/t/edited-htaccess-and-now-im-getting-discourse-sso-expired-error/86848 "2018-05-05T20:43:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Sami\_Syed](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sami_syed/32/93193_2.png) [@Sami\_Syed](https://meta.discourse.org/u/Sami_Syed)
#### Post date: [5월 5, 2018, 8:43오후 UTC](https://meta.discourse.org/t/edited-htaccess-and-now-im-getting-discourse-sso-expired-error/86848/1 "2018-05-05T20:43:37Z")

</div>

I am using my wordpress site to function as an SSO client. Meaning Discourse authenticates all users (logins, registrations, etc..).

After editing my **htaccess file** to increase my wordpress site speed. I noticed that the following error started to appear when I try and login “discourse\_sso\_error=expired\_nonce”.

I looked through the forum and found out that the issue is probably because of the htaccess file. Although, I want to know what exactly I should remove from it. So that I can keep my site speed as fast as possible while also solving this problem.

Here is the code in htaccess

```
    # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/opentype

# For Olders Browsers That Can’t Handle Compression
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 month"
</IfModule>

# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"

```

---

<div class="post-metadata">

### Author: ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)
#### Post date: [5월 6, 2018, 4:10오전 UTC](https://meta.discourse.org/t/edited-htaccess-and-now-im-getting-discourse-sso-expired-error/86848/2 "2018-05-06T04:10:32Z")

</div>

Above code looks incomplete. Also, below one looks wrong.

```
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 month"
</IfModule>

```

It will set max-age for 30 days for everything, it will cause terrible browser caching issue with your site. Please avoid. Rest your choice!

- Instead of using manual .htaccess code, just use one cache plugin and it will handle all common stuffs in better way.
- Or, implement a CDN to handle GZIP and Browser Cache which you are trying to do using above codes.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [6월 8, 2024, 12:37오후 UTC](https://meta.discourse.org/t/edited-htaccess-and-now-im-getting-discourse-sso-expired-error/86848/3 "2024-06-08T12:37:34Z")

</div>

이 주제는 2225일 후 자동으로 닫혔습니다. 더 이상 새 답변을 남길 수 없습니다.
