简体   繁体   中英

Remove file extensions without using .htaccess

Is there a way of removing file extensions from my URLs without using .htaccess?

Like if my URL is http://example.com/index.html , can I make it http://example.com/index without using .htaccess?

The reason I ask is because I do not have access to the .htaccess file.

It is possible and widely covered here . I will not copy paste whole article here.

You can also have urls like

http://example.com/index.php/your/fancy/url out of the box with PHP5. You can then read the URL parameters using

echo $_SERVER['PATH_INFO']; Remember to validate/filter the PATH_INFO and all other request variables before using them in your application.

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