2013-03-19 110 views
0

我使用的是Joomla 2.5附带的标准.htaccess文件。 Joomla安装在根目录下,我使用搜索引擎友好的URL。当使用搜索引擎友好的URL时,Joomla中的自定义目录

我可以在.htaccess文件的开头添加一些东西,它会检查我的URL中的自定义目录,并允许在没有任何URL重写的情况下进行正常访问?

例如,如果我想customdir /为我所有的我自定义的页面和脚本目录我会链接到像http://mysite.com/customdir/customscript.php

这可能吗?

回答

1

您可以尝试在标准的Joomla .htaccess文件中加上几行,低于2注释行内:

## Begin - Custom redirects 
RewriteCond %{REQUEST_URI} ^/customdir  [NC] 
RewriteCond %{REQUEST_URI} !customscript\.php [NC] 
RewriteRule .* /customdir/customscript.php [L] 
## End - Custom redirects 

地图默默:

http://mysite.com/customdir/

http://mysite.com/customdir/anything/

收件人:

http://mysite.com/customdir/customscript.php

对于永久和可见重定向,代替[L]与[R = 301,L]