Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8654749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:51:46+00:00 2026-06-12T14:51:46+00:00

index.php $admin_cookie_code=1234567890; setcookie(JoomlaAdminSession,$admin_cookie_code,0,/); header(Location: /administrator/index.php); .htaccess file RewriteEngine On RewriteCond %{REQUEST_URI} ^/administrator RewriteCond %{HTTP_COOKIE}

  • 0

index.php

$admin_cookie_code="1234567890";
setcookie("JoomlaAdminSession",$admin_cookie_code,0,"/");
header("Location: /administrator/index.php");

.htaccess file

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/administrator
RewriteCond %{HTTP_COOKIE} !JoomlaAdminSession=1234567890
RewriteRule .* - [L,F]

i used this code but it’s not working…
page will be redirect to administrator but http://www.domain.com/administrator is also accessable

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:51:47+00:00Added an answer on June 12, 2026 at 2:51 pm

    I got tired of searching an answer for this one and just made a PHP code that will redirect if the visitor gets into the /administration folder without the security key or as a registered user:

    Just place this code at the end of the index.php file on your administration folder (/administration/index.php) before the ‘echo’ instruction:

    /* Block access to administrator
     --------------------------------------------- */
    $user =& JFactory::getUser();
    $secretkey = 'mysecretkey';
    $redirectto = 'location: yourdomainurlhere';
    $usertype = 'Registered';
    
    //Check if the user is not logged in or if is not a super user:
    if ($user->guest || (!$user->guest && $user->usertype != $usertype) ) {
     //Check if the secret key is present on the url:
     if (@$_GET['access'] != $secretkey) { header($redirectto); }
    }
    /* --------------------------------------------- */
    

    After you will be only able of accessing your site using:
    mysite.com/administrator/?access=mysecretkey

    Tested on Joomla 1.5 and Jooma 2.5, worked well for both.

    I explain it a little bit more on my page:
    https://www.infoeplus.com/protect-your-joomla-administrator-folder/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Options -Indexes RewriteEngine on Options +FollowSymLinks RewriteRule ^$ 2012/index.php [L] RewriteCond %{DOCUMENT_ROOT}/2012%{REQUEST_URI} -f RewriteRule
index.php <?php require_once('fr.php'); header('Location:'.abspath().directory()); ?> fr.php <?php require_once('functions.php'); ?> functions.php function abspath() { return
This is my .htaccess: RewriteEngine ON RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)
Let say i've the follow files [index.php / admin.php / access.php] 1) File index.php
i need script sucha as here: http://demo.opensourcecms.com/joomla/administrator/index.php Admin Username: admin Admin Password: demo123 Script
I have folders and pages /admin/add/index.php, /admin/edit/index.php & /admin/view/index.php which all are requiring page
The following is my directory structures: admin\ controls\ images\ media\ lib\ models\ views\ index.php
I have folder home/admin. In this folder there is index.php. When i access to
I have the following link on index page <td align=center><a href=../athena/admin/update.php?id=' . $data [keyword]
In core.php I can define Configure::write('Routing.admin', 'admin'); and /admin/controller/index will work. but if I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.