Wordpress: remove page search by date - wordpress

In wordpress, I want to remove page: http://domain.com/2016/03/16/
I mean: when somebody access this page, content is not found 404

There are multiple ways to do this. First and easier is using a plugin. This one for example:
https://wordpress.org/plugins/simple-301-redirects/
Or you can edit your .htaccess file located on the root of your website. Then add a rule to redirect the page you want to the 404 page of your site.
#This allows you to redirect /2016/03/16/ to /404/ (assuming the path to your 404 page is /404/
Redirect 301 /2016/03/16/ http://domain.com/404/

Related

htaccess, rewriteurl to page of WordPress site in sub-folder

Here's the scenario, I have a single server and two WordPress sites living in their respective sub-folders:
public_html/site_one/
public_html/site_two/
These sites display as follows:
www.site.com/site_one/
www.site.com/site_two/
The second of those sites has a splash page / landing page:
www.site.com/site_two/landing-page/
...that needs to display in the root of the site:
www.site.com/
I'm aware that there are better ways of achieving this, but I'm restricted to working with how it's currently set up.
Initially I thought I would be able to set up a .htaccess file in the root that rewrites access to the root of the site to display the landing page from site_two, but this isn't working as expected. This is the .htaccess file from the root of the server:
RewriteRule ^$ subfolder/page-slug [L]
This redirects to the site's front page. If I replace page-slug with ?p=1234 then it displays as the correct page but also seems to redirect to the landing page's full URL.
Is there any means of achieving what I'm after?
To clarify:
User visits site.com
URL displays as site.com
Page displayed is site.com/site_two/landing-page/
I've managed to have this behaviour working when not linking to a WordPress page (using a test index.php in 'test-subfolder') but WordPress and its own .htaccess file seems to be confusing matters.
Any help would be appreciated. Is there a way of excluding the landing page from the WP .htaccess file and what is it about the WP .htaccess file that's stopping the page being displayed at the root of the site?

How to redirect a custom link to a 404 page?

In wordpress, I have plugin links that I don't want anyone accessing, therefore I want to redirect them to a 404 template that is in my child theme template, I searched and couldn't find anything related.
Let's say the links are:
http://example.com/wordpress/myPlugin/?r=34
http://example.com/wordpress/myPlugin/?r=3
http://example.com/wordpress/myPlugin/?r=
http://example.com/wordpress/myPlugin/?r
http://example.com/wordpress/myPlugin/?
The default response for the first link works fine, however altering these links as shown above would return a disclosure error that disclose file paths or info
You could use a simple 301 redirect in your .htaccess file
Redirect 301 /oldfolder/page2.html /folder3/page7.html
or there are many plugins (paid and free) that accomplish this for you through a pleasant GUI.

Is it possible to create a separate 404 page for a WordPress site within a WordPress site? Any suggestions on how to do this?

Iam a newbie at wordpress and I have a WordPress site that is contained inside a sub-folder of another WordPress site. I am wondering if it is possible if I can create a separate 404 page for the site that is contained in the sub-folder. I tried to create a 404 page but when I tried to test it, the 404 page of the root site appears. Any suggestions on how to make this work? Thank you very much.
Put a .htaccess file in the subfolder and have it contain:
ErrorDocument 404 /404.html
Where /404.html is the path to the correct 404 page.

Redirect from a .asp page / Access database

I need this page:
http://address.com/research/staff/profile.asp?id=p0026510
to redirect to basic HTML page.
Is there anyway I can do this? I have seen on here some answers about making a 301 redirect but I am not sure how to set one of these files up.
I have tried typing:
Redirect 301 /research/staff/profile.asp?id=p0026510 /about/staff/p0026510/p0026510.asp
Into the .htaccess file but it doesn't seem to work.

wordpress : how to put an enter page?

ive created an enter page for wordpress and what im wondering is how do i put it as the index page when the index page has the code to load wordpress? how and where do i place the enter page? thanks
There's setting in wordpress admin page which doesn't involve manual setting in .htaccess.
Besides the fact that splash pages are so very wrong... (the only defensible exception I can think of is for an adults only site that asks you if you are 18 or older), you could set it up as index.html and ensure your .htaccess has
DirectoryIndex index.html index.php
Things that you could do ...
Put the splash page on /index.html and put wordpress in /site/ (or something else innocuous); put a redirect on /index.html -> /site/ after the splash is done.
Put the splash page as a page named 'Splash' in Wordpress, with its own template. In the Reading settings page, set the 'Front Page' as 'Splash'. Redirect to the index page after the splash is done.
Put the splash page as a page named 'Splash' in Wordpress, with its own template. Modify index.php in your theme to check for a cookie -- if the cookie isn't present, load the Splash page instead of processing the Wordpress Loop. Once the splash page is done, set the cookie and redirect to the index page.
A route that's worked for me is to bypass the WordPress core files and do everything from your theme folder. So, for example, in your theme folder (WEBROOT/wp-content/themes/YOURTHEMEFOLDER) add a home.php file, and in that file, add whatever code you'd like to use for that first page. By default, WordPress looks for a file named home.php, if it finds it, it will use it first, if it doesn't find it, it will use the index.php next. Since you'd like to use both, it will use home.php for your home page / site default page & then every other page can use the index.php page.
Also, there's other template files that WordPress will look towards before it displays the index.php page - for a detailed list / illustration of this go to http://codex.wordpress.org/Template_Hierarchy & scroll down a little.

Resources