HOW TO add new PHP pages to the site?

Talk and info about common issues

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

Site Admin
Site Admin
Posts: 5962
Joined: Jan 7th, '09, 23:18

HOW TO add new PHP pages to the site?

Postby administrator » Dec 9th, '13, 07:13

Adding a new page is very simple procedure.

1. Create a page, for example my_page.php and place it in page/ directory

2. From now you may access this page with following URL index.php?page=my_page

3. If you need to add handler (the code that will be run before all procedures) create a handler named handler_my_page.php and place it in page/handlers/ directory. The system will detect it automatically and run before running all other code.

4. The same procedure you may perform for admin or user files.

5. Now you may define SEO rules for your page. check your .htaccess file includes the following command:

Code: Select all

RewriteRule ^pages/([0-9]+)/(.*).html$ index.php?page=pages&pid=$1 [L]

Check what ID of your new page and you may access the page with following links:

Code: Select all

- or (if you have not page ID) -

Code: Select all

RewriteRule ^page/MyPage.html$ index.php?page=my_page [L]

Of course, you may also create any other SEO rules to your pages.

Return to “ApPHP MicroCMS {HOW TO}”