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 7592553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:56:07+00:00 2026-05-30T20:56:07+00:00

This is my .htaccess: RewriteEngine ON RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)

  • 0

This is my .htaccess:

RewriteEngine ON

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php

Options -Indexes

It is used in a simple framework and the idea is to redirect request like: http://www.domain.com/subpage to index.php, which will call the subpage.

And my index.php is:

    function __autoload( $className ) {
    $className = strtolower( $className );
    // Trying to find proper directory. For pages - all the predefined languages' directories must be present and checked!
    $file =  'pages_pl/' . $className . '.php';
    if( file_exists( $file ) ) { require( $file ); }
    else {
        $file =  'pages_en/' . $className . '.php';
        if( file_exists( $file ) ) { require( $file ); }
        else {
            $file = 'lib/' . $className . '.php';
            if( file_exists( $file ) ) { require( $file ); }
            else {
                $file = 'admin/' . $className . '.php';
                if( file_exists( $file ) ) { require( $file ); }
            }
        }
    }
}


// Get page class
$pageClass = Parameters::page();

$language = null;

if( $pageClass == '' )   //if the class was not given, one depending on language will be called
{
//take language from the cookie, if present and valid
    if(isset($_COOKIE['lang']) && Language::exists($_COOKIE['lang'])) {
        $page = new Language::$MAINPAGE[$_COOKIE['lang']];
    }
    else {
        $defaultMainPage = Language::getDefaultMainPage();
        $page = new $defaultMainPage();  //default main page
    }
}     //if the specific class exists, it will be loaded
else if( class_exists( $pageClass ) ) //this makes __autoload() run
{
    $class = new ReflectionClass( $pageClass );
    if( $class->isInstantiable() )
        $page = new $pageClass();  //instantiate proper page here
    else
        $page = new Error404();
}
else
    $page = new Error404();

$language = $page->getLanguage(); //get the page's language     

?>
     //replaced triangle parentheses with round ones
    (head)
   ....
    (/head)
    (body)
        displayPart( 'top' );
        //print_r( $_SESSION );
            $page->displayContent();
            $page->displayPart( 'footer' );
        ?>
    (/body)
(/html)

And the Parameters class:

// This class decomposes URL address and returns: page, parameter1, parameter2 ...

class Parameters
{
    static private $isInitialized = false;
    static private $values;

    private function __construct() { 
    }

    static private function init()
    {
        if( self::$isInitialized == true ) return;

        $url = substr( $_SERVER['REQUEST_URI'], strrpos( $_SERVER['REQUEST_URI'], '/' ) + 1 );


      if( strpos( $url, '?' ) )
      {
          $url = substr($url, 0, strrpos($url, '?'));
      }

        self::$values = explode( ',', $url );

        self::$isInitialized = true;
    }

    static public function page()
    {
        self::init();
        return self::$values[0];
    }

    static public function get( $index )
    {
        self::init();
        if( $index < count( self::$values ) ) return self::$values[$index];
            else return null;       
    }
}

Can anyone help please?

  • 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-05-30T20:56:08+00:00Added an answer on May 30, 2026 at 8:56 pm

    OK. Seems like I have .htaccess that works:

    RewriteEngine ON
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(index\.php|images|css|js|robots\.txt|favicon\.ico)
    RewriteRule ^(.*)$ index.php/$1 [L]
    
    Options -Indexes
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my .htaccess: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d RewriteRule
This is the content of my .htaccess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME}
I've got this in htaccess RewriteEngine On RewriteRule ^records$ records.php [L] RewriteRule ^records/$ records.php
I have this code in my .htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule
My htaccess have this code # # Apache/PHP settings: # Options -Indexes Options +FollowSymLinks
I have the following in my htaccess files: Options +FollowSymLink RewriteEngine on RewriteCond %{REQUEST_FILENAME}
In my application's .htaccess file I have the following: Options -Indexes RewriteEngine on RewriteCond
This is currently my htacess file: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond
I have this in my .htaccess: RewriteRule ^account /?i=a [L] RewriteRule ^account/banners /?i=a&p=b [L]
This is a simple htaccess question for experts but I have been trying to

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.