site only shows all info from index.php? - php

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

Related

Webiste url are not routing without index.php

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.

Redirecting from an old site to a new site

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.

Bring local site to live site url not working

I have developed a site using drupal 7. I have moved my site from local server to live server.
But the live Url not opening my sites index page. For example, my web site address is http://test.com. But if i change the URL like http://test.com/2index.php it works well. Somebody help me please
File name should be index.php not 2index.php.
I agree the that file name should be index.php, however if there is some reason why the name must be 2index.php and you want it to serve as an index, you need to modify your apache config file to include "2index.php" as one the options for the "DirectoryIndex". The config line may look like this:
DirectoryIndex index.php index.phtml index.html index.htm 2index.php

Website - Not Showing Index

Ok, I am very new to web development, so excuse that. I set up my webserver using a Linode Stackscript (LAMP). However, my webpage doesn't display my actual index.php file, instead, it displays http://www.imgbomb.com/i/?lBqKe. Why is this? My index.php is inside my www. When I type /index.php after the url, I get a the page you are looking for is not found.
You should add DirectoryIndex index.php to your .htaccess file or webserver configuration file.

How to display .html page

I had a index.html page and index.php file are in the same folder .My folder name is Tester and also i had the sub domain with the same name. i am using the following URL www.Tester.hoster.com/ . My issue is, if i use the above link it directly show the .php file. how i display the .html page instead of .php page plz guide me thanks in advance
DirectoryIndex index.html
Add this in your .htaccess file
This is something that you need to update on your server. Depending on if you're using Windows ( IIS configurations should handle this ) or Linux (.htaccess should handle this)
.htaccess:
DirectoryIndex index.html
You can also add more file names/extensions after index.html, they will be treated by priority in the order in which you list them.
Not sure about ISS, sorry.
There are several ways to do it, URL Rewrite being a smart option.
A quick technique is to change the name of the index.php file to something else, say home.php.

Categories