You can access all pages from your site through a one page. It can be possible in .htaccess. In this type, you have to specify the other page urls on that one page.
Syntax:
RewriteRule ^(.*)$ index.php?url=$1 [L]
Where, when you try to access any pages in your site, at first your index.php file run. Then it
navigate to where you fixed it to go, it goes to that page. In your index.php should be like this:
$url=explode('/',$_GET['url']);
if($url[0]=='home.php') {
require_once('home.php');
}
where, you try to access your home.php file, first it comes to index.php and then check whether the home.php page is present or not. It navigates to home.php, if it is present in your site.
You can also hide all your files except home page:
Syntax:
RewriteRule ^(.*)$ index.php
where, whatever you type in your address bar, you should be navigates to your index file.
Related Post:
Syntax:
RewriteRule ^(.*)$ index.php?url=$1 [L]
Where, when you try to access any pages in your site, at first your index.php file run. Then it
navigate to where you fixed it to go, it goes to that page. In your index.php should be like this:
$url=explode('/',$_GET['url']);
if($url[0]=='home.php') {
require_once('home.php');
}
where, you try to access your home.php file, first it comes to index.php and then check whether the home.php page is present or not. It navigates to home.php, if it is present in your site.
You can also hide all your files except home page:
Syntax:
RewriteRule ^(.*)$ index.php
where, whatever you type in your address bar, you should be navigates to your index file.
Related Post:
What is htaccess?
Restrict users to access pages from site using .htaccess
Compressing resource with gzip using .htaccess
How to create error document using .htaccess
How to add expires headers using .htaccess
How to add MIME types using .htaccess
How to enable SSI using .htaccess
How to force script to display as source code using .
How to prevent access to php.ini file using .htaccess
How to enable or disable directory list using .htaccess
How to redirect urls using .htaccess
How to redirect to www using .htaccess
How to enable short tag in php using .htaccess
Restrict users to access pages from site using .htaccess
Compressing resource with gzip using .htaccess
How to create error document using .htaccess
How to add expires headers using .htaccess
How to add MIME types using .htaccess
How to enable SSI using .htaccess
How to force script to display as source code using .
How to prevent access to php.ini file using .htaccess
How to enable or disable directory list using .htaccess
How to redirect urls using .htaccess
How to redirect to www using .htaccess
How to enable short tag in php using .htaccess
No comments:
Post a Comment