I'm trying to call an URL (e.g : http://localhost:2000/index.n/test), but the server will try to find test.n like that, and I would like to go in index.n file and get index.n/test as request's path. How could I do that please ? (I'm using Haxe)
(in PHP it works)
Thank you very much,
Peekmo
if you're using nekotools server to test your neko scripts, you will need to launch it with nekotools server -rewrite. If you're using apache, you will need to use mod_rewrite.
Related
i want to write a little Cakephp3 application for a friend. Now i developed a part of the application locally and i want to install this on his server. He got a managed server at strato.de. I have no access to a shell or something like this to configure everything by myself.
What i did already to solve the problem:
I googled around and found several things about some definitions in the htaccess-files: .htaccess for cakephp but it didn't solve my problem.
I also read the installation-guide of cakephp.
The problem:
I can't access the application. If i try to open the url i only get a complete white page. So what do i have to do to access the application?
Thanks for help!
Put this lines in you root index.php file to show all errors
error_reporting(E_ALL);
ini_set("display_errors", "on");
(overhead this line)
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
But I imagine a message like this...
Fatal error: You must enable the intl extension to use CakePHP in ... cakephp/config/bootstrap.php on line 38
I talked with Strato about it, but they didn't give me any solution for shared hostings...
If it's any info, I checked hostings strato and its support laravel5
I'd like to create a simple site on NodeJS. For example, it has two files (app.js - main application file) and router,js (a url file). I'd like to know - if it possibke for anyone just to access mydomain.com/router.js to get the source code of my application? I'm asking 'cause for example in PHP you cant just access to php, as you know server just gives you the result of working of this PHP-file, but not the file itself. So, how to make my nodejs-app invisible for public access? Thanks!
I make sure that all files for Node.js are never in a path that is served by another web server such as Apache. That way, there is little danger of the source ever being served by accident.
My node program's and files go in /var/nodejs with a sub-folder for each application in Node. By default of course, Node will not serve ANYTHING unless you tell it to.
At the root of my Apache configuration, I make sure that ALL folders are secured so that I explicitly have to enable serving on any folder structure even under the /var/www folders that I use for all Apache sites.
So you are pretty safe with a default setup of Node and Apache as long as you keep the folders separate. Also Node will not serve source code accidentally, you would have to set up a Node server that read the file as text and wrote it to the http stream.
That depends on how you are using Node.js and what you are using for a web server in front of it. Unlike PHP running as CGI or as a module in Apache, node and the node application itself is a server.
If you have a webserver with your node source directory exposed then the url you provided in the question will most likely result in your source code being served. Even if you were using Apache and proxying to node, there is usually no output filter involved. Instead requests are passed to the backend node server which interprets them.
If I try wget <url> it downloads the resolved page. But I want to download the original script. Is this possible?
No, and thank goodness for that. The server is completely in control of how it responds to your HTTP requests.
Strictly speaking, you can't tell whether it's PHP on the other end of the wire in the first place.
No this is not possible, and would be a huge security issue if it was.
The only way this would be possible is if the web server (Apache) was not configured correctly
This is not possible, the webserver doesn't output the PHP script. The webserver parses it serverside and writes the response of that to the client.
"Officially" - no.
Through "hacking" - yes. If a website allows to download some content via /download.php?src=path_to_file script, AND it was poorly coded, then you could request to download, say, index.php file.
Check this out: https://owasp.org/www-community/attacks/Path_Traversal
I need some help writing a .htaccess file.
I'm using a Flash based theme and it creates URLs like this:
http://www.mysite.com/#/pagetitle
How can I redirect these to:
http://www.mysite.com/pagetitle
?
Apache (and anything that runs serverside) can not access anything after #; that part is the fragment and available to client side only (JavaScript).
You will need to use JavaScript to access that programmaticly.
Basically i developed my app on a localhost wamp server with PHP 5. ON uploading to the actual host i notice that
The server is running php 4.4.9
Everytime i upload my .htaccess file, the server removes it completely.. seems to not be allowed
When i test out the set all i get is a 404 page not found
Any help on how to make it work on this PHP 4 server?
I did a test with CI 1.7.2, default installation.. works on my local server but when uploaded does not work, does this mean that the server does not support it?
I'm sure this isn't what you want to here, but get a new server. Here are the reasons why:
PHP 4 is no longer well supported. It's insecure.
If the server is removing .htaccess files, they are also unsupported on that server, giving you one more reason to move.
Code Igniter runs best with PHP 5 and with an .htaccess file.
The gist of this is you are going to have to hack your code back into the dark ages to get this to work, and then you will still have pretty URL issues and overall system instability. If you can make the switch, do.
If you cannot use .htaccess files with CodeIgniter, in system/application/config/config.php there is a configuration key called index_page. You need to set that to whatever page you have bootstrapping CodeIgniter (usually /index.php)
Then, make sure all your links that get routed through CI either target index.php/controller/action/params... or utilize the URL helper (with site_url or anchor) to automatically put in the index.php
Joe Mills is exactly right in his answer, though. CI works best with PHP 5 and .htaccess.
See CI URLs and CI URL Helper for documentation.
Well i found out how to fix several things
The issue with .htaccess would be to just not use modrewrite as such i put "query_string" option in my path variavable and this works.
The other issue, which was the major issue was that i was using Datamapper library which is a php 5 only library.