开发者

htaccess redirect remove /app/webroot in cakephp

开发者 https://www.devze.com 2023-03-07 16:33 出处:网络
I have an htaccess file that I want to redirect the all pages to the another folder. I am using cakephp for the site, except for this folder which I want to redirect.

I have an htaccess file that I want to redirect the all pages to the another folder. I am using cakephp for the site, except for this folder which I want to redirect.

"/app/webroot/" is added to the new directory so the url is /app/webroot/new/ instead of just new.

I am placing this htaccess file (below) in the "new" directory and want anything at /app/webroot/new/ to redirect to /new/ and remove the /app/webroot/ This folder is independent of cakephp and thus does not need to be processed by cake.

The code below loops and I am not sure why.

Options +FollowSymlinks
RewriteEngine On
RewriteBase /new/


# If your concerned about direct access to a particular page withou开发者_如何转开发t the sub-dir 
# you will want to add something like this
RewriteCond %{REQUEST_URI} !^/new
RewriteRule (.*) /new/$1 [R=301,L,NC]


You should NOT place the .htaccess file in /new/ but in /app/webroot/new/.

0

精彩评论

暂无评论...
验证码 换一张
取 消