简体   繁体   中英

Show URL (/index.php/dashboard) without PHP extension

I have a running web application at my webserver. After the login dialog (login @ www.mydomain.com) you will redirect to this URL: mydomain.com/index.php/dashboard.

How can I hide the .php extension in my URL?

I tried it hard with some .htaccess settings, like "I HAVE NO IDEA WHAT I'M DOING" :DI need your help guys!

My last .htaccess condition:

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /index.php [L] 

Without using .htaccess you can achieve this using folders to structure each page.

For example your dashboard; you create folder dashboard in your root directory and then create an index.php file in that folder. The file will contain the html/php code for your dashboard. Now you can access your page as mydomain.com/dashboard

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