Wordpress - Disable front end to use as CMS only?
To make sure only the front end redirects to domain.com
, make a theme that uses the PHP header() function.
- Create a folder called redirect or something.
- Add two files to the
folder:
style.css
andindex.php
(necessary for a valid WP theme) In
style.css
, add something like this:/*
Theme Name: Redirect
Description: Redirects the front end to domain.com
*/In
index.php
add this:header( "Location: http://domain.com" );
- Upload the folder to the themes directory and then activate it in the admin UI.
Use a theme with "empty data". Put two files in directory, then activate "theme".
style.css
/*
Theme Name: turn off frontend
Theme URI:
Description:
Author:
Version:
License: GNU
License URI:
Tags:
*/
and index.php
<?php
exit;
Put this in your .htaccess and list the paths you want to keep available:
RewriteCond %{REQUEST_URI} !^/wp-admin
RewriteCond %{REQUEST_URI} !^/wp-includes
RewriteCond %{REQUEST_URI} !^/wp-login
RewriteCond %{REQUEST_URI} !^/wp-content/uploads
RewriteCond %{REQUEST_URI} !^/wp-content/plugins
RewriteCond %{REQUEST_URI} !^/wp-content/cache
RewriteRule (.*) http://yournewdomain.com/ [R=301,L]