There is a running website (on Bitrix CMS) located on the simplest shared hosting with cPanel. The task is to create a standalone little web application in PHP (for internal use in the company), which, for simplicity, will be available from the same domain, but, what is important, it will not affect the already running site.
On the hosting, in the file manager, there is a public_html folder - as I understand these are the site files. I created in public_html a subfolder (for example, webapp) and added a couple of test files (for example, test.txt). The test file is supposed to be available at site.com/webapp/test.txt, but nothing is loaded - just a white screen, no error messages.
Trying with text files and simple php-scripts - the same result, just white screen.
How to fix it?
Check your .htaccess on site root, it maybe redirecting all routes to index.php of Bitrix CMS.
Alternatively you can follow above answer and create a subdomain.
Simple tutorial here.
You can create a subdomain and point your public_html folder there.
You need to create an Index.php file in the subdirectory, in hosting any folder must have this file which will be executed any time you access that directory with URL.
Related
I want the URL of my site to look like this 'https://example.com/mainPage/subPage/anotherSubPage' to have a better website directory. I am using Azure web app server and I can't seem to find the web.config folder even when using Advanced Tools.
These are the contents of my \wwwroot folder.
I even searched it in every folders. Can't find them. Thank you
If you are using Kudu, you can find the web.config under the folder \home\site\wwwroot.
I have just created a simple REST Api following this small video using Slim Framework 3.x. I was just getting started and I followed the instructions in the video and created a simple route like this
$app->get('/', function($request, $response)
{
return 'Home';
});
This works on localserver (XAMP) when I open the link `
localserver/project_name/public/
` I get "Home" returned on the page.
After that I simply Zipped the project folder and uploaded it to my Web Hosting, htdocs folder. I extracted the zipped project, which included the "composer.phar" and "vendor" folder. I try the same thing again, i.e., I run the url
www.mysite.com/project_name/public/
All I've done is change "localserver" with www.mysite.com but the browser tells me that my domain
is currently unable to handle this request.
I know this might be something very obvious but I am a novice in php and REST Api's. So any help is appreciated. Also some things I think might matter are, The web hosting that I am using is Plesk based. I have a mysql database Running on the hosting and simple php files run when run individually. For example if I run simple call a test.php file with some database query in it and some echo, it will run successfully. Even if you can point me in the right direction, I would appreciate it. Oh, and I don't have access to php.ini on the hosting. I was only provided with one login that lets me login to the hosting and I can see htdocs folder among some others. I have attached an
image of the view I get after logging in, to give you more perspective of the type of hosting I have. I am hosting a website in the httpdocs directory as well. ASP.NET developed
I just need some direction as to what I need to do to be able to publish my REST api to my hosting and be able to access it through this android app that I am building. What do i need to do on my server? What settings to change to make the api work?
I'm currently working on a project in Symfony.
Now i have deployed the project to production.
I've noticed that if i go to domain.com/var/logs/prod.log than i'm able to download the file. Is there a way to protect everything outside the Web directory so that no matter what you type in the url you will be redirected to the web directory.
Or let me know if you have an other method to block access.
Because now i think that the project is not that secure now that i found this error.
Thank you in advance
Even if you have a subdomain you have to point it to web directory and don't upload all symfony files in public folder.
If your subdomain is a subfolder then you can upload symfony project somewhere and make a symbolic link from web folder and place it anywhere you like.
I don't know if it is even possible so that's why I put my question here.
We have a webserver running a PHP application build within the Yii-framework and we have also integrated Wordpress into that application.
The root contains the Yii-application and a dir with the wordpress installation. Now I would like to know if it's possible to create a page and have it a url outside it's installation dir.
An example:
domain.com shows the Yii application index
domain.com/blog shows the Wordpress homepage
Now I want to create domain.com/foobar and the page foobar comes from Wordpress.
Is it possible and how?
Kind regards,
Pim
Your server will have been setup with your domain name. I don't know if you are using a hosted service, or a cloud based option, but either way you should be able to tell your web server to load different index.php files based on the URL.
Every single web request comes through your web server. You can tell your web server to load different php files depending on the http request URL.
For example, when you setup your sever with domain.com you would have had to (or in most cases its the default) tell your web server to route all domian.com requests to /public/index.php
Following this logic, if you want to load a different index.php file from a different URL, you just have to set this up in your web server. So domain.com/foobar would point to /some/directory/public/index.php
The way you do this very much depends on your server and if you have some server admin software installed e.g. cPanel.
Is there any way to have the admin area of open cart located on my own server and have it accessible from there while having everything else located on the client's server and using the same database (which would be located on the client's server as well)?
I know all the admin files are located in the admin folder it can't be as simple as just uploading those files to my server, is it? I'll be using Opencart 2.0.
The theoretical answer to this is yes, you can.
You'll need to have the system folder on both servers since both the admin and catalog rely on the base classes to run.
On your client server you'll need:
catalog/*
config.php
crossdomain.xml
image/*
index.php
install/*
php.ini
system/*
On your admin server you'll want to make the normal admin folder your document root. So instead of adminserver.com/admin you'll just use adminserver.com
Admin server setup:
config.php
controller/*
index.php
language/*
model/*
view/*
php.ini
system/*
Then in your adminserver/config.php you would simply adjust you paths and db info as appropriate.
But the "real world" answer to this in no, you can't.
If you did do this, one of the main controllers in the admin area, file manager would not work.
File manager relies on the public images folder to upload images for your products. On a separate server the file manager would attempt to upload images to image/data which you could create on your adminserver, but obviously this wouldn't carry over to your client server.
You'd need to FTP your images to the client server with the exact same name and route as the admin server. Plus this could be extremely problematic for extensions. How would you set up modifications? Or extensions that have image parameters?
If maybe you had a CDN module in place, that might resolve the issue ... tough to say for sure.
Just keep in mind, once you've completed the install, you can change the config paths to whatever you like.
You don't have to use admin as your admin area, you can change it to steve or aardvark or whatever you like in the config file.
Having it on a separate server would be ideal, but for OpenCart, it's really not practical in a real world environment.