New domain name; only Plain permalinks working
-
I switched a government website from a .com domain to a proper .gov URL.
All good, except only the plain permalinks are working. When I switch back to Post Name permalinks and save twice, the pages won’t render at all, and I only get a redirect error.
Example of former working URL:
https://sixcounty.com/housing-community-action/crisis-programs/
Now:
https://r6.utah.gov/?page_id=3208
What’s wrong? How do I remedy this?
I asked tech support at my host (Namecheap) but switching to Plain Permalinks was their only remedy.-
This topic was modified 2 years, 2 months ago by
websta.
-
This topic was modified 2 years, 2 months ago by
-
Change under Settings > Permalinks e.g. to “Post name”. See: https://wordpress.org/documentation/article/settings-permalinks-screen/
Yes, of course. However, when switched to another permalinks setting, there are redirect errors–no pages display properly/at all.
You use Litespeed to optimise loading times. Have you also emptied its cache?
Unfortunately, I can’t see whether your server uses nginx or Apache. If it is Apache, the .htaccess file generated by WordPress should actually enable the permalinks. If it is nginx, a server-side configuration is required. This may still be missing.
Here is the .htaccess file, which looks incorrect to me:
# BEGIN WordPress
# The directives (lines) between “BEGIN WordPress” and “END WordPress” are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
# END WordPress
If you need the Site Health info (and it’s not a security concern), please let me know.-
This reply was modified 2 years, 2 months ago by
websta.
Sorry, here is the actual .htaccess file, currently, minus the hashtags which aren’t copying over:
BEGIN LSCACHE LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! RewriteEngine on CacheLookup on RewriteRule .* - [E=Cache-Control:no-autoflush] RewriteRule .litespeed_conf.dat - [F,L] marker ASYNC start RewriteCond %{REQUEST_URI} /wp-admin/admin-ajax.php RewriteCond %{QUERY_STRING} action=async_litespeed RewriteRule .* - [E=noabort:1] marker ASYNC end marker CACHE RESOURCE start RewriteRule wp-content/./[^/](responsive|css|js|dynamic|loader|fonts).php - [E=cache-control:max-age=3600] marker CACHE RESOURCE end marker FAVICON start RewriteRule favicon.ico$ - [E=cache-control:max-age=86400] marker FAVICON end marker DROPQS start CacheKeyModify -qs:fbclid CacheKeyModify -qs:gclid CacheKeyModify -qs:utm* CacheKeyModify -qs:_ga marker DROPQS end LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! END LSCACHE BEGIN NON_LSCACHE LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! END NON_LSCACHE BEGIN WordPress The directives (lines) between "BEGIN WordPress" and "END WordPress" are dynamically generated, and should only be modified via WordPress filters. Any changes to the directives between these markers will be overwritten. RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] END WordPress BEGIN Security Block Block the include-only files. RewriteEngine On RewriteBase / RewriteRule ^wp-admin/includes/ - [F,L] RewriteRule !^wp-includes/ - [S=3] RewriteRule ^wp-includes/[^/]+.php$ - [F,L] RewriteRule ^wp-includes/js/tinymce/langs/.+.php - [F,L] RewriteRule ^wp-includes/theme-compat/ - [F,L] Disable directory listing Options All -Indexes Remove header with PHP version Header always unset X-Powered-By Header unset X-Powered-By END Security Block BEGIN LiteSpeed The directives (lines) between "BEGIN LiteSpeed" and "END LiteSpeed" are dynamically generated, and should only be modified via WordPress filters. Any changes to the directives between these markers will be overwritten. SetEnv noabort 1 END LiteSpeed order allow,deny allow from all deny from 157.245.201.74 deny from 94.156.64.75 deny from 91.92.241.245 deny from 91.92.246.225 deny from 173.249.52.101 deny from 173.249.52.122Have you also checked which web server you are using for hosting? If it is nginx, the htaccess file is not used at all.
Server Name premium230
cPanel Version 110.0 (build 24)
Apache Version 2.4.59
MySQL Version 10.6.17-MariaDB-cll-lve
Architecture x86_64
Operating System linux
Shared IP Address…
Path to Sendmail /usr/sbin/sendmail
Path to Perl /usr/bin/perl
Perl Version 5.26.3
Kernel Version 4.18.0-513.11.1.lve.el8.x86_64Looks ok, the .htaccess should be read. Write a spelling mistake in the .htaccess to test whether it is also used, e.g. simply an
aaaaat the beginning of the file. If you then get an error message when you call up the page, it will be loaded. If not, it will not be loaded and something needs to be adjusted in the hosting configuration.With the site set to “plain permalinks,” I added “aaaa” in line one of .htaccess (via editing using file manager in cPanel), saved that, reloaded the public pages, and they loaded just the same — loading correctly, but using plain permalinks.
Is that what I was supposed to do? What does that mean?Then the .htaccess is not executed and not used. As a result, the regulation cannot take effect. You would need to clarify what needs to be configured in cPanel for it to be used.
Thank you very much for your help, Threadi! Your comments led me to a remedy.
It seemed like the problem was with Litespeed server/caching thing/whatever it is.
Here’s my solution: I activated the Litespeed Cache plugin. I flushed the cache using the plugin, leaving it activated. Then, I changed the permalinks to from “Plain” to “Post name.”
On my PC, the pages appeared still broken, and since I was thinking about caching — this time in my browser — I double-checked the site, remotely, via Browserling.com.
Viewing the site remotely, the pretty permalinks worked, using “Post name.”
Apparently, while I was thinking things over, the caching had apparently been updated for the site and although my browser is still showing a broken (home) page from the browser’s cache, the rest of the site’s pages are appearing properly, as they had before (using Post names) — but now, with the new domain name.
All’s well. Thank you again, Threadi! I appreciate your insights and help.I want to add one other mistake I made, in case anyone else runs into this problem. At a certain point, the underlying pages worked fine, but the homepage would have redirect errors. The problem turned out to be a capital letter in the subdomain in the WordPress settings: R6.utah.gov instead r6.utah.gov.
-
This reply was modified 2 years, 2 months ago by
The topic ‘New domain name; only Plain permalinks working’ is closed to new replies.