简体   繁体   中英

Running php file by avoiding extension .php in the url without using .htaccess

In my Localhost:
Without using .htaccess, I created a folder named test and a file test.php. I can run the file from url http://localhost/test/test

In my amazon server with cpanel:
I put the same folder with that file but displays internal server error after checking the url http://example.com/test/test

I tried: Changing the Allowoverride None to All
enabling mod rewrite

This is actually for a large project. But using a test in this case.

It is possible to rewrite URLs without an htaccess file. That's because you can also use rewrite rules in the Apache configuration files. In a VirtualHost block for example. I guess your localhost is set up that way, so take a look in those server config files.

For your amazon server to work, you either can work with an htaccess file (easiest way) or you can put those rules in the server config files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM