We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Can admin.php be changed to admin?

How Do I?

Bobe's avatar
Bobe
19 posts
9 years ago
Bobe's avatar Bobe

For the sake of clients, I would like for them to not have to bother with the .php extension. How can I easily change it so all they have to enter is domain.com/admin?

I tried some rewrite rules in .htaccess but was just getting infinite redirects.

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil

Yes, it can be done, but you still need to tell your server to parse “admin” (the file) as PHP. This is what I use in my .htaccess:

<Files "admin">
ForceType application/x-httpd-php
</Files>
       
Bobe's avatar
Bobe
19 posts
9 years ago
Bobe's avatar Bobe
Yes, it can be done, but you still need to tell your server to parse “admin” (the file) as PHP. This is what I use in my .htaccess:
<Files "admin">
ForceType application/x-httpd-php
</Files>

Do I need anything else? That just produces what appears to be a 404 page (generic EE error: The page you requested was not found).

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil

You have renamed admin.php to admin, of course, i.e. without the suffix?

       
Bobe's avatar
Bobe
19 posts
9 years ago
Bobe's avatar Bobe
You have renamed admin.php to admin, of course, i.e. without the suffix?

You mean in the URL?

I managed to get /admin to redirect to /admin.php with this:

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]

Ideally though I’d like it to remain as /admin in the URL.

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
9 years ago
Ingmar Greil's avatar Ingmar Greil
You have renamed admin.php to admin, of course, i.e. without the suffix?
You mean in the URL?

I was referring to the actual file on your server.

       
kmartens's avatar
kmartens
155 posts
9 years ago
kmartens's avatar kmartens

You could also just do one of two things…

  • Rename the system folder to “admin”
  • If you prefer to hide the real system folder, or its below root, you can just rename the admin.php file to index.php and place it an empty directory called “admin”. Then adjust the the system path and it should work without any messy .htaccess rewrites etc 😊
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.