PHP page in the wwwroot folder - php

I am trying to upload my localhost site that I am making to the live server. Before I did that I made a test with a "hello world" index.php
When I place my index.php on the following path the page is working:
but that is not in the wwwroot.
When I place the index.php in the wwwroot folder I do not get to the hello world page. I just get the domain page.
How can this be? I also noticed that my page should be dangerous in the URL bar. It is just a portfolio, there is nothing dangerous on that site.

According to discussion in comment,
You need to set/change your DOCUMENT_ROOT directive as below
DOCUMENT_ROOT /customers/0/f/c/vouzalis.com/httpd.www
to
DOCUMENT_ROOT /customers/0/f/c/vouzalis.com/httpd.www/wwwroot
If you are not managing your server, you can ask hosting for setup.

You need to verify your Apache VirtualHost configuration. You need something like:
DocumentRoot /wwwroot/

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.

Can't access php files in folder using XAMPP

I have troubles accessing my php files in a folder. When I click on the folder, it brings me to a page on chrome which says "Bad data passed, return to home (which is a hyperlink to the actual website)". Then when I click on the hyperlink, it runs on an online server of the main page instead of localhost. How do I fix this problem?
You need to resolve the host to your local ip in the hosts file, in /etc/hosts add at the end of the file
127.0.0.1 yourdomain.com
127.0.0.1 www.yourdomain.com
where yourdomaoin.com is your domain. Put also the www subdomain if you use it
You may have problems with .htaccess (in root public_hrml folder). Try to rename it to .htaccess_backup and check again.
If that doesnt help, post here exactly what url you are being redirected to.

Mapping host name Zend2

I have developed a site recently which home page opens when i hit this url but i want to open my site home page when user hit only this link.
update your apache vhost configuration and set the DocumentRoot to ght/public/
If you only have access to the data directory, but not to the apache config itself, you can add a .htaccess with contents (must be allowed by the server):
RedirectMatch 301 /(.*) /ght/public$1
Alternatively, why don't you upload your PHP and HTML files directly into the webserver root? (above the /ght/public/ directory) What access to you have to the webserver?

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

Directory of "index.html" on site

I wonder if the index.html MUST be in the "www" folder on the server after uploading the site?
This because I have actually made everything in a folder called "SV", so my site is located in : "www/SV/index.html"
My Q is, on the server, could I just create a folder named "SV" under "www" and expect index.html to be automatically displayed ones the users type in the web-adress to my site?
Thanks
well, if they went to www.yoursite.com/SV then it would display. If you don't want that, you have a few options:
Put an "index.php" file in the "www" directory and have it redirect to the one in the /SV folder.
Change the apache configuration to tell it the site is located in the /SV directory.
Use mod_rewrite rules in your .htaccess file to rewrite URLs so they go to the /SV directory.
But my first question would be why don't you just put it in the "www" directory?
You should configure your web server so that the document root points to the path where your index.html is located
In general, any directory may be assigned as the web-root.
But in your particular case of shared web-hosting I doubt you can have access tho the server config to do it.
Though there can be some tricks done, using PHP or mod_rewrite. With more certain question describing background, you can get more certain answer.

Categories