Htaccess to reach antoher page

dat11

New Member
Jul 6, 2024
1
0
1
I need an advice.
I can't edit the htaccess file so that by typing the address domain.com/ucloud I may be redirected to a specific public share.
Example
mydomain.com/ucloud -> https://mydomaind/ucloud/folder/0c926659aaaaaaadf9345c7f11c5f0e/My-Folder.

For login purposes would be ok for me to type https://mydomain/ucloud/account/login when needed.

I bought from codecanyon some year ago. Now i need a different setup.
If you cannot edit the .htaccess file, you can use a PHP script to handle the redirection. Here’s how you can set it up:
  1. Create a PHP Redirection Script:
    • Create a new file called redirect.php in the root directory of your website.
  2. Add Redirection Code to redirect.php:
  3. Create a URL Alias:
    • If you can't modify the .htaccess file, you can create an alias or route in your web server configuration. However, assuming you don't have access to the web server configuration, you can handle it through a PHP file.
  4. Access the Redirection:
    • When you navigate to mydomain.com/ucloud, the server should serve the redirect.php file, which will handle the redirection to the specified URL.
  5. Setting up a Simple Login Page(optional):
    • Create a file called login.php in the ucloud directory.
    • Add the following basic HTML form for login:
      html
      Copy code
      <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Login</title>
      </head>
      <body>
      <form action="https://mydomain/ucloud/account/login" method="post">
      <label for="username">Username:</label>
      <input type="text" id="username" name="username" required>
      <br>
      <label for="password">Password:</label>
      <input type="password" id="password" name="password" required>
      <br>
      <button type="submit">Login</button>
      </form>
      </body>
      </html>
  6. Update Links:
    • Ensure any internal links point to mydomain.com/ucloud for the redirection and mydomain.com/ucloud/login.php for the login page.
 
Last edited: