Change Startup Page of a WordPress website - php

I have an installed WordPress website.
I'm working on the site, therefore, I want to show a constructor page for the internet user. I have created a page which called first.html and I change the .htaccess file like below
#Alternate default index page
DirectoryIndex first.html
Now when I enter my domain name on the browser I can see the first.html. This is working properly.
I'd like to see my changes by entering the domain and page name on the browser like
www.mydomain/index.php
or
www.mydomain/wp-content/themes/XXXTHEME/index.php
However, my theme pages don't work.
How can I achieve to do this?

Instead of making changes in .htaccess, I'd suggest you to use this plugin : https://wordpress.org/plugins/maintenance/

Simply name your html file "index.html"
Web servers most commonly parse the index.html file firstly (unless told otherwise) and if it is not found, it proceeds to index.php
This also allows you to simply change that ".html" part to ".php" to see the website you are working on, without installing plugins that clutter your database or making unnecessary changes to your .htaccess file.

Related

Finding the source of a 301 redirect

I have a WordPress website at https://newable.xyz which is fine, if I go to https://newable.xyz/wp-admin I get redirected to https://newable.co.uk/money/financewp-admin.
This is definitely a 301 redirect.
I've tried the following things:
Deleting the redirecting plugin and all of its data
Clearing my browser cache
Using multiple different browsers
Using InPrivate/ Incognito
Using a fresh .htaccess file
Am I missing something obvious?
try search in your active WP theme - wp_redirect or wp_safe_redirect
_search in the theme to see if there is a wp_redirect or wp_safe_redirect as Vasyl said
_deactivate all plugins, both default and mu (a.k.a. mu-plugins) and analyse which one is causing you problems (if there is one that creates conflicts or creates the redirect).
_Try looking in the htaccess file (mod rewrite) of the root, every folder can have its own htaccess. You can have more than one .htaccess file on your hosting account, but each directory or folder can only have one, pay attention.
_Try to see if there is a server configuration (many hosting services have the ability to put a redirect to another domain)
-Delete the wordpress package in case it has been polluted with some injected code and download and reupload it.

Change home page to blog.php and add another home page

I have a WordPress installation on my website. Now I need to create a landing page (not WordPress) and, at the same time, maintain the WordPress installation on the same folder and still being able to access it with a different URL (e.g. www.mysite.com/blog.php instead of www.mysite.com).
So, to sum up:
index.php should be changed to blog.php
In this way, I can add a landing page (index.html) to my website
When accessing the website I should see the landing page (index.html), but still be able to see WordPress at www.mysite.com/blog.php (so, maintaining also the old permalinks to the blog)
I guess I should be changing the .htaccess file and maybe the settings of the blog, but I'm not able to find anything on the web (probably, I don't know what to look for).
By default server show index.html file first. you should not create a blog.php page. if in a directory has two files index.html and index.php you will see index.html when you visit your site.
just create an index.html page it will automatically show at first.
and if it not works .. just backup your .htaccess and delete it until you are working on developing.
That's it.

Multiple Choices - broken link

I uploaded a new website at the same place the old one was (I deleted the old one). When I type the address of my site in browsers url (www.mywebsite.net) it works just fine. But when I type "mywebsite" in google and click on the first result, it says:
Multiple Choices
The document name you requested (/index.php/) could not be found on this server. However, we found documents with names similar to the one you requested.
Available documents:
/index.html/?language=hr (common basename)
Please consider informing the owner of the referring page about the broken link.
Does it have something to do with the .htaccess file? I tryed changing it didn't help. Both index.html and .htaccess are in the root.
Any ideas? Thx.
What is the default file for your new site? According to the error, index.php used to be the default file when only the directory was specified in the GET request. Now it seems you use index.html as your default file, so Google has not yet updated its indexes to recognize index.html instead of index.php. If that desperate, you can rewrite /index.php and redirect it to /index.html in the .Htaccess file.

html front end on joomla based site

thanks in advance for any and all suggestions.
I am trying to put a temp site built in Adobe Muse in place of the existing Joomla site
and I am wondering if in doing that, I can till link to the original Joomla site.
eg: as an "archive" page perhaps.
If not, I'd still like to be able to do that without damaging the original Joomla site itself.
The original Joomla site doesn't need to be seen (online).
I don't want to work in Joomla, I don't want a Joomla plug-in.
thanks in advance.
If your Adobe Muse website has an index.html (instead of index.php), then this will work for you, all you need to do is to ensure that your .htaccess file first processes the index.html file, and then the index.php file. So, in order to access your Joomla website, your link should be http://www.yourwebiste.com/index.php . Here's the line that you should add in your .htaccess file:
DirectoryIndex index.html index.php

Why would index.php only work some of the time?

I just moved a develoment site onto a test production server and I'm testing some things out.
When you go to the root URL (ie rooturl.com), the browser is correctly rendering rooturl.com/index.php without showing the index.php in the address bar.
However, I also have a directory at rooturl.com/admin that also has an index file of index.php, but when I go to rooturl.com/admin I'm getting a 404 not found error. But if I type out rooturl.com/admin/index.php, it loads the page.
Is there a common reason for this?
The last piece of relevant information is that since my client won't switch their domain name to the new host until they are ready with migrating email, etc., I'm currently not able to view the site on the registered URL, I can only access it using the IP address directly which I got from the host.
My gut feeling is that the direct IP address is screwing with how it would normally work, but it's just a guess and I have no idea why that would be the case.
Sounds like it could be an .htaccess rewriting issue. Be sure to check any .htaccess file (hidden, by default) in those directories for any screwy rewrite-rules.
If you're running a MVC project, then the url /admin may be confused for a call to a controller rather than a directory.
My first shoot is that you have .htaccess file and it is redirecting everythind to your root index.php file.

Categories