Jump to content

Recommended Posts

hello i'm building a website and i have a new folder structure on it which require apache htaccess files the first file should redirect to public_html folder and the second one should be used for loading all pages inside of index.php and the link should be the form of index.php?url=home&lang=en can you please check it out and see if it's done correctly ? thank you very much :D

this file goes inside of public_html file and it's for redirecting all the calls to index.php and load pages there.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>

this code is for redirecting to public html

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    public_html/    [L]
    RewriteRule    (.*) public_html/$1    [L]
</IfModule>

 

oh i alomost forgot i don't know if i have url rewriting on it i'm beginner to htaccess files....

Link to comment
https://forums.phpfreaks.com/topic/175902-folder-redirect/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.