Question

URLs Get redirected to root for webroot files

  • 12 September 2019
  • 0 replies
  • 47 views

Badge +1
I have a CakePHP app that has some html static files in
code:
webroot
. HTML files are in some directories like
code:
webroot/dir1/dir2/page.html
. When I enter url:
code:
site.com/dir1
I get redirected to
code:
site.com/webroot/dir1/
but when I enter
code:
site.com/dir1/
I get redirected to the first page
code:
site.com
And If I enter url for the html file:
code:
site.com/dir1/dir2/page.html
I get redirected to the first page
code:
site.com
. It supposed to show the html file. How can I make it show html file and not redirect to first page?

In my public_html the htaccess is:

code:

RewriteEngine on
RewriteRule ^$ webroot/ [l]
RewriteRule (.*) webroot/$1 [l]



In the webroot the htaccess is:

code:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [l]


0 replies

Be the first to reply!

Reply