LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-07-2018, 11:27 AM   #16
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,488

Rep: Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558Reputation: 1558

Check under Posts > All Posts and then delete any you don't want any more.
Do the same for Pages > All Pages
Change your permalink structure to something else and SAVE IT, that should cause all the permalinks to re-generate, and then change it to what you want it to be and SAVE IT.

Try that and see if it clears up any of your outstanding problems.
 
Old 11-07-2018, 12:03 PM   #17
6th_sense
Member
 
Registered: Jun 2006
Distribution: Centos 7.x, Fedora (one version behind latest)
Posts: 147

Original Poster
Rep: Reputation: 6
Hi TenTenths,

I don't have any trash items. I don't have any items waiting for the trash any more either.

I've tried changing the structure - when I move to say "Plain" permalinks, inexistent pages then get redirected to my home page (without the URL changing).
So, for instance: mywebsite.com/inexistent/ -> when entered simply renders the home page and the other URLs get handled without any problems. So, mywebsite.com/?page_id=21 will
yield the correct page (if such a page exists).

When it is switched back to "post name" in the permalinks setting which gives the example: "http://mywebsite.com/sample-post/" - the 404 Error page shows when inexistent URLs are entered, but, it still renders the menu bar at the top and right hand sides.

-6th-

Last edited by 6th_sense; 11-07-2018 at 12:14 PM. Reason: clarification of last line
 
Old 11-07-2018, 12:17 PM   #18
6th_sense
Member
 
Registered: Jun 2006
Distribution: Centos 7.x, Fedora (one version behind latest)
Posts: 147

Original Poster
Rep: Reputation: 6
Hi guys,

Just thought I would note:

I find it strange that different permalinks settings causes the inexistent pages to be treated differently.

Not sure why, of course.
 
Old 11-07-2018, 03:49 PM   #19
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by 6th_sense View Post
I changed the permalinks to "http://mywebsite.ca/?p=123" and this allows the page to be posted.
and this is The Default, thank God for defaults! At least you know your site is functional.

Something wrong with PermaLinks?
https://codex.wordpress.org/Using_Permalinks
https://codex.wordpress.org/Settings_Permalinks_Screen

What .htaccess mods did you induce?
 
Old 11-08-2018, 02:57 PM   #20
6th_sense
Member
 
Registered: Jun 2006
Distribution: Centos 7.x, Fedora (one version behind latest)
Posts: 147

Original Poster
Rep: Reputation: 6
Hi Habitual,

(all the URLs I present are just samples - not of my actual website, since I don't wish to present myself additional security issues)

I hadn't adjusted my .htaccess file to be seen from an SELinux standpoint and I had it enforcing... So, I changed it this afternoon. Mind you nothing changed since then (in spite of changing the Permalinks a couple of times back and forth after).

I read a couple of things on the net:

1. One individual reports that he couldn't get permalinks working until he removed everything else from his .htaccess file. I have WPFastestCache - which requires several lines of it's own in there.

2. A second individual writes of his situation that he couldn't get it working, because he had multiple installations of WordPress - as soon as he made the second install, his first one stopped working - ie the .htaccess stopped being updated.

I have two web URLs managed by wordpress. One is http://mywebsite.ca/ and the other is http://mywebsite.ca/videos/

My .htaccess remains the same regardless of what changes I make to permalinks. But, switching between the default URL (http://mywebsite.ca/?page_id=273, and http://mywebsite.ca/existent-page/) both work, except for the pages that are inexistent. Again, in the first case, I simply get my website homepage when I enter http://mywebsite.ca/inexistent/ (without the URL changing in the web browser) and in the second case, when I enter http://mywebsite.ca/inexistent/, I get the top menu bar, a side menu bar and a "404 Not Found" tab title.

I tested the .htaccess using diff between changes and there is no difference - even though I get a report from wordpress that "Permalink structure updated."

Here is the wordpress .htaccess file lines:

<<<<=================== BEGIN CONTENT =============>>>>

# BEGIN WpFastestCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.mywebsite.ca [NC]
RewriteRule ^(.*)$ http\:\/\/mywebsite\.ca\/$1 [R=301,L]
# Start WPFC Exclude
# End WPFC Exclude
# Start_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP:Cookie} !wordpress_logged_in_[^\=]+\=P_6thSense
# End_WPFC_Exclude_Admin_Cookie
RewriteCond %{HTTP_HOST} ^mywebsite.ca
RewriteCond %{HTTP_USER_AGENT} !(facebookexternalhit|LinkedInBot|WhatsApp|Mediatoolkitbot)
RewriteCond %{HTTP_USER_AGENT} !(WP\sFastest\sCache\sPreload(\siPhone\sMobile)?\s*Bot)
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !(\/){2}$
RewriteCond %{REQUEST_URI} \/$
RewriteCond %{QUERY_STRING} !.+
RewriteCond %{HTTP:Cookie} !comment_author_
RewriteCond %{HTTP:Cookie} !woocommerce_items_in_cart
RewriteCond %{HTTP:Cookie} !safirmobilswitcher=mobil
RewriteCond %{HTTP:Profile} !^[a-z0-9"]+ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
RewriteCond /var/www/html/wp-content/cache/all/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/all/$1/index.html" [L]
</IfModule>
<FilesMatch "index\.(html|htm)$">
AddDefaultCharset UTF-8
<ifModule mod_headers.c>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Mon, 29 Oct 1923 20:30:00 GMT"
</ifModule>
</FilesMatch>
# END WpFastestCache
# BEGIN LBCWpFastestCache
<FilesMatch "\.(webm|ogg|mp4|ico|pdf|flv|jpg|jpeg|png|gif|webp|js|css|swf|x-html|css|xml|js|woff|woff2|ttf|svg|eot)(\.gz)?$">
<IfModule mod_expires.c>
AddType application/font-woff2 .woff2
ExpiresActive On
ExpiresDefault A0
ExpiresByType video/webm A2592000
ExpiresByType video/ogg A2592000
ExpiresByType video/mp4 A2592000
ExpiresByType image/webp A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType image/svg+xml A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/font-woff2 A2592000
</IfModule>
<IfModule mod_headers.c>
Header set Expires "max-age=2592000, public"
Header unset ETag
Header set Connection keep-alive
FileETag None
</IfModule>
</FilesMatch>
# END LBCWpFastestCache
# 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

<<<<=================== END CONTENT =============>>>>

Last edited by 6th_sense; 11-08-2018 at 03:02 PM.
 
Old 11-08-2018, 05:03 PM   #21
6th_sense
Member
 
Registered: Jun 2006
Distribution: Centos 7.x, Fedora (one version behind latest)
Posts: 147

Original Poster
Rep: Reputation: 6
Hi guys,

Just made a change to the permalinks to default (plain): http://mywebsite.ca/?p=123 - the .htaccess file changed. It removed the section for wordpress. When I re-instated the pretty permalinks, it went right back to what was seen above.

Not sure why it wasn't working earlier though.

It appears that it is the default Divi 404 error page that was showing up and I can make changes to it by adding my own page to my child theme.

Thank you guys for looking at this problem with me for so-o-o long now!

Problem solved! Finally!

Last edited by 6th_sense; 11-08-2018 at 05:05 PM. Reason: thank you.
 
  


Reply

Tags
centos7, security, theme, wordpress



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wordpress Install: Bringing up default Apache page? oguruma Linux - Newbie 3 03-10-2017 09:14 AM
wordpress index page is not working as before ilnli General 6 03-28-2007 02:45 PM
I cant change the default test page in apache server to add my page.y nhemapriya Linux - Newbie 3 05-13-2004 12:35 PM
web page accessing port 4662 before allowing connect? skog Slackware 2 03-12-2004 02:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration