Indicate home page inside a folder on my site

Asked

Viewed 714 times

-1

I have a website, where I created some html pages inside a folder, as I can specify to home page, once user accesses the briefcase and the chosen page opens automatically? I tried by index.html naming inside the folder, it didn’t work...

(Remembering that it is dendro of a folder, in the server root when I put index.html works normally!)

  • 1

    Usually when specifying the server folder you want to access, Exp: "www.test/pasta1/subfolder" the server already automatically redirects to the page you are on as index.html // index.php // index.asp, ai depends on the server implementation....

  • I understand, but in my house it’s not working, what can I do?

  • Depends on which server you are using.

  • 1

    @Eduardof.Santos you are using Apache?

2 answers

0

The ideal would be to rename it to index, however will only work if your site is on an apache server, unlike.

0

Redirect in PHP Redirecting pages in PHP To make the user when accessing a particular address of your site be redirected to another address, inside or outside your site, you must use the Location: parameter of the header() function. Below is an example of basic use of this function:

The way it is above, whenever the user accesses the page containing the above code, it will automatically redirect to http://www.seusite.com.br/pasta. Redirecting is not restricted to absolute addresses of websites, and you can also redirect to folders within your FTP, or even files that are in the same folder using a path relative to it. To better illustrate this, we will create a script that will capture the address you are accessing, and redirect the user to another as per this access address.

Remembering that for the above script to work, all entries used in the script must be created in DNS.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.