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.
Related
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.
I uploaded my website from my UAT/Test domain to EC2 AWS. Before everything was fine, but now only home page opens.
And if I try to navigate to any other links I can't, it gives following error
The requested URL /page/company was not found on this server.
But when I insert index.php in between it works fine.
Any ideas?
Please enable mod_rewrite module in your server and rewrite index.php in htaccess file.
Please check your file premissions
I believe the issue could be DirectoryIndex which apache (not positive that is what you are using as web server) uses to direct the user to a specific file if a directory is selected in the URL.
This can be set in your apache config if you have access, or in a .htaccess file if you only have access to the your webspace itself.
http://www.htaccess-guide.com/directoryindex-uses/
Basically with DirectoryIndex you can tell apache to automatically use index.php, or index.html, or really whatever file you want to be used when no file in a directory is given in the URL.
I have a very peculiar problem. Formerly, I was using Wordpress and I have a link that has a path of http://www.acetraining.com.sg/index.php/contact-us/.
I have just reverted the website to a non-Wordpress and have a static link of http://www.acetraining.com.sg/contact_us.html. How is it possible for me to redirect the old path to this new path? I already have a redirector script and I know I have to place this code :
<meta http-equiv="refresh" content="0; url=http://example.com/" />
to the head region of a html page. What I have done is that I've created an index.php as a folder name and another contact-us as a subfolder and then I created an index.html file within that but it does not work at all.
Any suggestions anyone?
Good morning!
I think that using meta tag for redirection will not good for your SEO. As it is a definite URL moving, I suggest you the header 301 (Redirect Permanent). You can use this by creating a .htaccess file in public_html (or your website public root directory) and put on something like this :
RedirectPermanent /index.php/contact-us/ http://www.acetraining.com.sg/contact_us.html
Hope this may help you.
If you don't have a .htaccess file in your server root!
Create an empty text file using a text editor such as notepad, and save it as htaccess.txt and add the code blow.
Options +FollowSymLinks
RewriteEngine On
# Redirect old file path to new file path
Redirect index.php/contact-us http://www.acetraining.com.sg/contact_us.html
NOTE:
The reason you should save the file as htaccess.txt is because many operating systems and FTP applications are unable to read or view .htaccess files by default. Once uploaded to the server you can rename the file to .htaccess
hopefully it will fix the redirection for you.
Sorry if this is a basic question, but Im wondering why my site doesn't display correctly unless I utilize the index.php extension. Here is an example :
www.copishboutqiue.com/salon
which displays incorrectly but
www.copishboutique.com/salon/index.php displays the correct layout we're using. Why do I need to use the index.php when this is the only file in the root directory?
if you are using an apache server create a .htaccess file in the root directory of your website and add
DirectoryIndex index.php
Ok so my current sites is on the .htaccess method to block user access to the directory
e.g. http://www.example/_directory/ via Options All -Indexes
Question should I stick with that or is putting an index file e.g. index.php in every directory better? I'm thinking of an index.php that will redirect to the homepage rather than giving users an error 403 page.
Opinions?
It would be clever to build your web site in a way that these subdirectories also have content (e.g. about/ also shows some information, when about/history/ and about/our-company/).
If the directories contain only files, it's IMHO totally fine to just have a 403.
Answers to your questions might be very biased.
If you're on a Unix/Linux server, you don't need to have blank index files at all in your directories. Just create a .htaccess file and put the following code in it:
Code:
Options -Indexes
When anyone tries to access the contents of a directory that doesn't have an index file, they'll get a 403 error.
Ref : http://wildlifedamage.unl.edu/manual/mod/core.html#options