使用.htaccess将特定URL重定向到正确的文件夹

时间:2014-10-30 15:01:14

标签: php .htaccess cakephp

我想知道是否可以将URL专门设置在.htaccess内重定向到重定向到我的应用程序文件所在的正确文件夹?到目前为止,我在.htaccess文件中所做的就是这样,

Options -Indexes

RewriteBase /mainfolder/cakephpfolder/

Options +FollowSymlinks
RewriteEngine on
RewriteRule    ^$ app/webroot/    [L]
RewriteRule    (.*) app/webroot/$1 [L]

我想要的是当我使用此网址http://www.mysamplesite.org/desired/url时,它将使用/mainfolder/cakephpfolder/中的文件。基本上,我想掩盖我之前的我的网址,看起来像http://www.mysamplesite.org/mainfolder/cakephpfolder,并使其看起来像我想要的网址。那可能吗?非常感谢你。

1 个答案:

答案 0 :(得分:0)

尝试类似:

RewriteRule ^desired/url$ /mainfolder/cakephpfolder/ [NC,L]