This is going to sound crazy, but the following worked… I put the content in the following directory:
/var/www/myexamplesite.com/public_html
(and created log/ as well)
Along with the following entry in httpd.conf
<VirtualHost *:80>
ServerAlias www.myexamplesite.com myexamplesite.com
DocumentRoot /var/www/myexamplesite.com/public_html
ServerName www.myexamplesite.com
# Log file locations
LogLevel warn
ErrorLog /var/www/myexamplesite.com/log/error.log
CustomLog /var/www/myexamplesite.com/log/access.log combined
<Directory /var/www/myexamplesite.com/public_html>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</Directory>
</VirtualHost>
That’s it!
Related Posts:
- Including category-base in a post permalink results in 404
- WordPress thinks my custom route is a 404
- Page preview is shown, updating page gives 404 error
- Permalinks 404 error with HTTPS host
- Visiting posts results in 404 errors after host migration
- 404 permalink errors on Pages only
- WordPress pages and posts are redirecting to server IP address instead of domain URL [closed]
- how to set up wp in folder within static website?
- The requested URL was not found on this server [closed]
- WP-e-commerce (getshopped) – Annoying permalink issue [closed]
- MySQL-inserted custom taxonomy term lead to 404, flush rewrites doesn’t help
- Folder Name and Category Name WordPress
- Although rewrite engine is on, I get 404 not found on every page
- Need help with add_rewrite_rule
- After server migration only the homepage works
- remove “index.php” from permalinks
- Changing permalinks gives me 404 errors on nginx
- How do I add /blog/ as a prefix to permalink structure for blog posts, tag pages, etc.?
- How does WordPress create URLs that Apache knows about?
- Passing and retrieving query vars in wordpress
- Permalink format: singular or plural
- How does WordPress handle permalinks?
- Pretty permalinks for search results with extra query var
- How to get pretty URLs with add_query_arg in permalinks
- Creating custom permalink structure for languages
- Custom post type permalink endpoint
- How to remove dates from existing permalinks?
- Getting the Site URL Including the Front Base
- Using $_GET variables in the URL?
- Setting 404 page in Nginx
- Date based URLs for custom posts and pagination
- How to add a custom URL placeholder to author archives?
- How to custom change author base without $this->front?
- URL rewrite based on a custom field value
- Update URL Snippet to Canonical Permalink URL
- How to prevent the default home rewrite to a static page
- “.#[random-char-string]” being inserted at end of URLs
- How to change author base without front
- permastruct for custom post type not working in one of four cases
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Pretty Permalinks
- Make post slug have priority over category slug
- Remove parent slug for child pages
- How to create a permalink structure for posts in a specific category
- How to remove the index.php in the url?
- How to map permalinks with accented letters to sanitized slugs?
- Homepage loads but all permalinks are 404 when using nginx & PHP-FPM
- Remove subfolders from URL
- Remove parent slug for child pages
- Add custom directory in URL
- Using two permalinks for one post
- 404 on category.php pagination
- flexible rewrite ‘ramble’ URLs with WordPress
- How can I Rewrite a ‘page’ URL based on query string parameters?
- Custom rewrite rules for a $_GET request
- Nice RSS Feed URLs for each custom post type
- Change the custom post type permalink
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- custom naming of search permalink /search/
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Posts not working on windows after changing permalinks
- Put post ID on the custom post type URL
- Rewrite url / permalink for default archive – yearly / monthly
- removed index.php now all pages 404
- Rewrite user profile URL to be human friendly
- WordPress on VirtualBox – no pretty permalinks
- Random Alphanumeric Key URLs
- Redirect old permalinks with Month and name to Post name on new site
- Permalinks, Rewrites, Get Variables, Oh My!
- Using WP rather than .htaccess to redirect pages/posts
- Change permalink for a single post entry
- Permalinks Structure and 404 Question
- Remove the Parent category from the permalink but leave the child category
- How to Modify Existing Rewrite Rules?
- Rewrite URL for results of a custom WP_Query
- Rewrite URL Parameter And Force ‘Pretty’ Permalink
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- Attachment page 404 not found when image is attached to post
- Apostrophe in permalink results in page not found
- Image Attachment Url Rewrite
- custom permalink/shortlink with base62 encoded post ID
- After moving from subdirectory to home, home page does not display
- Change permalinks with ACF values
- template_include not loading -instead goes to index.php
- Rewrite Page with a slug before page name
- Changes to permalink structure results in 404 error for all pages other than home
- Can’t get rewrite rules working
- permalink changed, now getting 404 for every pages
- Multilanguage URLs
- Rewrite my default post URL
- Permalinks broken regularly
- 404 Page Not Found for Only One Post
- Permalink /%category%/%postname%/ returns 404 on OSX
- Incorrect 404 for pages when using permalink, a static front page, and posts page
- add new permalink structure from dynamic page
- Permalinks keep reverting to 404 unless I re-save them
- When is it a good idea to build a permalink structure from scratch?
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- How to improve WordPress security by hiding non public facing files?