DM.*_*DM. 3 apache mod-rewrite wamp joomla1.5 joomla-sef-urls
我是Joomla和WAMP环境的新手.我正在使用WAMP环境:
我想用Joomla SEF URL启用mod_rewrite但它不能一起工作.
如果我将"SEF URL"和"将后缀添加到URL"设置为是,则可以.
结果:/index.php/page.html
如果我将'mod_rewrite'和'添加后缀添加到URL'设置为是,它不会给出任何错误(不确定它是否按照它假设的方式工作).
结果:/index.php?option=com_content&view=article&id=3&Itemid=5
如果我将"SEF URL"和"mod_rewrite"设置为"是",则会给出"404 Not Found"错误.
结果:未找到| /pagename
在此服务器上找不到请求的URL
如果我设置'SEF URL'+'mod_rewrite'+'将后缀添加到URL'为是,而不是它给我"404 Not Found"错误.
结果:未找到| /pagename.html
在此服务器上找不到请求的URL
我使用Joomla提供的默认.htaccess代码如下:
## Can be commented out if causes errors, see notes above. Options +FollowSymLinks # # mod_rewrite in use RewriteEngine On ########## Begin - Rewrite rules to block out some common exploits ## If you experience problems on your site block out the operations listed below ## This attempts to block the most common type of exploit `attempts` to Joomla! # # Block out any script trying to set a mosConfig value through the URL RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] # Block out any script trying to base64_encode crap to send via URL RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] # Block out any script that includes a tag in URL RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR] # Block out any script trying to set a PHP GLOBALS variable via URL RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] # Block out any script trying to modify a _REQUEST variable via URL RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) # Send all blocked request to homepage with 403 Forbidden error! RewriteRule ^(.*)$ index.php [F,L] # ########## End - Rewrite rules to block out some common exploits # Uncomment following line if your webserver's URL # is not directly related to physical file paths. # Update Your Joomla! Directory (just / for root) RewriteBase /abc # /abc is a sub-directory of joomla install in htdocs ########## Begin - Joomla! core SEF Section # RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/index.php RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC] RewriteRule (.*) index.php RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] # ########## End - Joomla! core SEF Section
在httpd.conf中
LoadModule rewrite_module modules/mod_rewrite.so
活动(未注释#
)我不知道还需要做些什么才能让它发挥作用.我查看了几乎所有论坛的帖子和博客.但没有任何帮助.
我也有PHP_MAILER问题,但这并不像这一样重要.我感谢您的帮助.如果您需要更多详细信息来解决此问题,请与我们联系.
亲切的问候
DM
我找到了问题的答案:我在httpd.conf中添加了目录,但是AllowOverride设置为None而不是All以允许.htaccess生效.
AllowOverride所有需要在那里使用apache来处理.htaccess.代码看起来像:
<Directory "D:/Apache/htdocs/joomla"> AllowOverride all Options None Order allow,deny Allow from all </Directory>
除了上面的更改,还需要有"RewriteBase /"
(设置为on,ieuncomment RewriteBase /)
归档时间: |
|
查看次数: |
18006 次 |
最近记录: |