Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 使用搜索引擎友好URL时Joomla中的自定义目录_Apache_.htaccess_Joomla - Fatal编程技术网

Apache 使用搜索引擎友好URL时Joomla中的自定义目录

Apache 使用搜索引擎友好URL时Joomla中的自定义目录,apache,.htaccess,joomla,Apache,.htaccess,Joomla,我使用的是Joomla 2.5附带的标准.htaccess文件。Joomla安装在根目录中,我使用的是搜索引擎友好的URL 我可以在.htaccess文件的开头添加一些内容来检查url中的自定义目录,并允许在不重新写入url的情况下进行正常访问吗 例如,如果我想要customdir/作为我的目录以及所有的自定义页面和脚本,我会链接到 这可能吗?您可以尝试将这些行添加到标准Joomla.htaccess文件中,在下面的两个注释行中: ## Begin - Custom redirects Rewr

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

我可以在.htaccess文件的开头添加一些内容来检查url中的自定义目录,并允许在不重新写入url的情况下进行正常访问吗

例如,如果我想要customdir/作为我的目录以及所有的自定义页面和脚本,我会链接到


这可能吗?

您可以尝试将这些行添加到标准Joomla.htaccess文件中,在下面的两个注释行中:

## 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]