Good day to all
I have such a question, how can you make it through a regular program such that in the address browser there is one link, but in fact the page that is being displayed is loaded via other links?
For example, in the address bar http://site.ru/ but the page http://site.ru/page.php is displayed

    2 answers 2

    It is necessary to write regular in RewriteRule / RewriteCond. PHP has nothing to do with it.

    RewriteCond %{REQUEST_FILENAME} -f RewriteRule (.*) page.php?q=$1 

    This is in htaccess. More - look for mod_rewrite right here. Well, or ask a specific question

      This is configured either in the server config.
      Or, if you write under the framework, it is prescribed in the routes.

      • I just need to do this: if the user is logged in, then the site.ru link displays one page (his profile) and if not, the login page is displayed - Blogaster
      • So you check the $ _POST array, if there is data there, and they correspond to the data in the database, then display your page, if not, to a friend. How to display a lot of ways. For example through inclode. - systemiv
      • and here is how through inklud? - Blogaster
      • php.su Just check the file first, and depending on the result, connect different templates ... - systemiv