Problemas E Mais Problemas Com Htaccess
#1
Posted 08/12/2008, 02:04
A questão é que estou montando um site e deu tudo certo. Acontece que para acessá-lo tenho que digitar
http://www.nomedosite.com.br/index.php. Digitando só o endereço sem o (index.php) dá uma mensagem de erro dizendo que a url não foi encontrada no servidor.
Pesquisando na net deduzi que esse é um problema que poderia ser solucionado editando o htaccess. Acontece que estou estudando, estudando e não chego a nenhum lugar.
O código do htaccess é esse:
Options All -Indexes
ErrorDocument 404 /404.php
FileETag MTime Size
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^sitemap\.xml$ feed.php?output_type=sitemap [L]
RewriteRule ^(.*)(\.html|\.htm)$ index.php [L]
RewriteRule ^(.*)(\.rss|\.atom|\.txt)$ feed.php [L]
RewriteRule ^([^.]*)/?$ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
</IfModule>
O que quero basicamente é que o internauta possa acessar o site sem ter que digitar o "index.php". Se alguém puder me ajudar com o caminho agradeceria.
#2
Posted 08/12/2008, 08:03
DirectoryIndex index.php index.html index.htm
#3
Posted 08/12/2008, 12:39
Acontece, que como programador sou um mero photoshopeiro e não sei em qual linha colocar esse código que você passou.
De qualquer forma muito obrigado pela atenção.
Tenta isso:
DirectoryIndex index.php index.html index.htm
#4
Posted 08/12/2008, 12:50
É pra funcionar em qualquer linha...
#5
Posted 08/12/2008, 12:58
Aliás uma pergunta, o server que tô usando não está habilitado o mod_rewritable, dá algum problema?
mas você tentou colocar em alguma linha?
É pra funcionar em qualquer linha...
#6
Posted 11/12/2008, 23:16
#7
Posted 12/12/2008, 12:41
Pra você entender a complexidade do problema esse é o meu htaccess:
<IfModule mod_rewrite.c>
RewriteEngine Off
ErrorDocument 404 index.php
</IfModule>
Obs: (Lembrando que só deixei a mensagem default e retirei o resto pois sem isso a meta refresh não funcionaria)
Esse é o meu index.html, com a meta e o hack IE6, que pelo que me falaram (acho que foi você), tem que ir no index.php:
<html>
<head>
<!--[if IE lt 6]>
<link rel="stylesheet" type="text/css" href="ie-5.0+5.5.css" />
<![endif]-->
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=index.php">
</head>
<body></body></html>
E esse é o meu index.php
<?php
/* =============================================================================
* $Revision: 2536 $
* $Date: 2008-02-08 11:42:01 +0100 (Fri, 08 Feb 2008) $
*
* Vivvo CMS 4.0
* Copyright 2005-07 SpoonLabs d.o.o.
* http://www.spoonlabs.com, All Rights Reserved
*
* Warning: This program is protected by copyright law. Unauthorized
* reproduction or distribution of this program, or any portion of it, may
* result in severe civil and criminal penalties, and will be prosecuted to the
* maximum extent possible under the law. For more information about this
* script or other scripts see http://www.spoonlabs.com
* ============================================================================
*/
$_generation_time = time();
require_once ('conf.php');
if (!defined('VIVVO_FS_INSTALL_ROOT')){
return false;
}
require_once (VIVVO_FS_INSTALL_ROOT . 'lib/vivvo/vivvo_lite_site.php');
require_once (VIVVO_FS_INSTALL_ROOT . 'lib/vivvo/box/vivvo_box.php');
if (ini_get('zlib.output_compression')){
ob_start();
}elseif (function_exists('ob_gzhandler')){
ob_start('ob_gzhandler');
}else{
ob_start();
}
define ('VIVVO_JS_COMPRESOR', VIVVO_URL . 'compress.php?js,');
$sm =& new vivvo_lite_site();
$um =& $sm->get_url_manager();
$dm =& $sm->get_dump_manager();
$template =& $sm->get_template();
$template->set_template_file(VIVVO_FS_TEMPLATE_ROOT . VIVVO_TEMPLATE_DIR . 'homepage/' . VIVVO_HOMEPAGE_LAYOUT);
if (VIVVO_CLOSE_SITE == 1 && !($sm->user && $sm->user->is_admin())){
$template->set_template_file(VIVVO_FS_TEMPLATE_ROOT . VIVVO_TEMPLATE_DIR . 'system/close_site.tpl');
echo $template->get_output();
exit;
}
$action = $sm->execute_action();
if ($um->isset_param('action') && $um->get_param('action') == 'login' && !$action){
$dm->store_dump(md5(VIVVO_URL . 'login.php'));
HTTP_Session::pause();
header ('Location: ' . VIVVO_URL . 'login.php');
exit();
}
$template->assign('DUMP_MESSAGES', $dm->_dump_pool);
if ($sm->user){
$template->assign('CURRENT_USER', $sm->user);
}
define('CURRENT_URL', htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
$sm->get_categories();
$header =& $sm->get_header_manager();
$header->add_script(VIVVO_URL . 'js/framework/prototype.js');
$header->add_script(VIVVO_URL . 'js/control_tabs.js');
$header->add_script(VIVVO_URL . 'js/functions.js');
if (VIVVO_MODULES_FEED == 1){
$header->add_rss(switch_format('rss', VIVVO_URL), VIVVO_WEBSITE_TITLE);
}
$sm->set_content();
$sm->set_theme();
if (file_exists(VIVVO_FS_ROOT . str_replace(VIVVO_URL, '', VIVVO_THEME) . '/css/compress.php')){
define ('VIVVO_CSS_COMPRESOR', VIVVO_THEME . 'css/compress.php?css,');
}
if ($um->isset_param('template_output')){
$template_file = $um->get_param('template_output');
$template_file = preg_replace('/[^a-zA-Z0-9\_\-\/]/', '', $template_file);
if (file_exists(VIVVO_FS_ROOT . VIVVO_TEMPLATE_DIR . $template_file . '.tpl')){
$box_template =& new template($sm, $template);
if (!empty($_GET)){
foreach ($_GET as $k => $v){
if ($k != 'template_output'){
$box_template->assign($k, htmlspecialchars($v, ENT_QUOTES, 'UTF-8'));
}
}
}
$box_template->assign('ajax_output', intval(1));
$box_template->assign('action', intval($action));
$box_template->set_template_file(VIVVO_TEMPLATE_DIR . $template_file . '.tpl');
echo $box_template->get_output();
}
exit();
}
//$template->assign('_generation_time', );
$output = $sm->get_output();
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">' . "\n";
echo str_replace('$generation_time$', time() - $_generation_time . 's', $output);
ob_end_flush();
?>
Gostaria se possível me indicasse onde poderia inserir a hack no index.php. Só tá faltando isso pra resolver o problema e colocar o site no ar. Como minha cidade é pequena e não tem curso de CSS e nem PHP em nenhuma escola estou me valendo dos seus conhecimentos.
Agradeço mais uma vez
Pampa
#8
Posted 12/12/2008, 23:09
http://www.vivvo.net...ates_system.php
Bem cara, eu preciso saber o que esta escrito nesse dois arquivos:
header.tpl
html_header.tpl
usa a tag codebox para colocar códigos de arquivos.
exemplo [tag] código [/tag]
me passa o código que a gente tenta achar uma solução.
Edição feita por: Édipo Costa Rebouças, 12/12/2008, 23:11.
#9
Posted 12/12/2008, 23:27
header.tpl
<div id="header">
<div class="header_image"><img src="{VIVVO_THEME}img/t9_header.gif" alt="header" /></div>
<div class="top_links">
<a href="{VIVVO_URL}"><vte:value select="{LNG_GO_HOME}" /></a> |
<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('{VIVVO_URL}');" href="#"><vte:value select="{LNG_SET_HOMEPAGE}" /></a> |
<a href="java script:bookmarksite('{TITLE}',document.URL);"><vte:value select="{LNG_ADD_FAVORITES}" /></a>
<vte:if test="{VIVVO_MODULES_FEED}">
| <a href="{CURRENT_URL|switch_format:'rss'}">Rss</a> / <a href="{CURRENT_URL|switch_format:'atom'}">Atom</a>
</vte:if>
<vte:if test="{VIVVO_MODULES_PLAINTEXT}">
| <a href="{CURRENT_URL|switch_format:'txt'}"><vte:value select="{LNG_PLAIN_TEXT}" /></a>
</vte:if>
<vte:if test="{VIVVO_MODULES_ARCHIVE_VIEW}">
|
<vte:if test="{VIVVO_FRIENDY_URL}">
<a href="{VIVVO_URL}archive"><vte:value select="{LNG_ARCHIVE}" /></a>
<vte:else>
<a href="{VIVVO_URL}index.php?archive"><vte:value select="{LNG_ARCHIVE}" /></a>
</vte:else>
</vte:if>
</vte:if>
<vte:if test="{CURRENT_USER.is_admin}">
| <a href="{VIVVO_URL}admin/index.php"><vte:value select="{LNG_SITE_ADMINISTRATION}" /></a>
</vte:if>
</div>
<vte:include file="{VIVVO_TEMPLATE_DIR}box/pages.tpl" />
<vte:include file="{VIVVO_TEMPLATE_DIR}box/search.tpl" />
E html_header.tpl
<head>
<base href="{VIVVO_PROXY_URL}" />
<title><vte:value select="{VIVVO_WEBSITE_TITLE}" /><vte:if test="{PAGE_TITLE}"> - <vte:value select="{PAGE_TITLE}" /></vte:if></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Vivvo 4" />
<meta name="generation-time" content="$generation_time$" />
<link rel="search" type="application/opensearchdescription+xml" href="openSearch.php" title="{VIVVO_WEBSITE_TITLE}" />
{$meta_names__}
{$rss__}
{$css__}
{$scripts__}
</head>
Valeu!
Antes de mais nada obrigado pela força
#10
Posted 13/12/2008, 00:33
[codebox]
<head>
<base href="{VIVVO_PROXY_URL}" />
<title><vte:value select="{VIVVO_WEBSITE_TITLE}" /><vte:if test="{PAGE_TITLE}"> - <vte:value select="{PAGE_TITLE}" /></vte:if></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Vivvo 4" />
<meta name="generation-time" content="$generation_time$" />
<link rel="search" type="application/opensearchdescription+xml" href="openSearch.php" title="{VIVVO_WEBSITE_TITLE}" />
{$meta_names__}
{$rss__}
{$css__}
{$scripts__}
</head>
[/codebox]
Você vai colocar o hack antes ou depois do {$css__}, esse código propavelmente puxa todas as css da pagina corrente, se você colocalo antes, ele vai aparecer antes das importações das css normais, se for depois, vai aparacer depois da importação das css.
Esse arquivo represente todos a parte do código do <head> até o </head> de todas as páginas que você usa o css para gerenciar.
Bem, acho que é isso, para ver se funcionou, é só abrir o código da index depois que você entrar no site.
Flw.
Edição feita por: Édipo Costa Rebouças, 13/12/2008, 00:34.
#11
Posted 13/12/2008, 10:45
Tentei:
<head>
<base href="{VIVVO_PROXY_URL}" />
<title><vte:value select="{VIVVO_WEBSITE_TITLE}" /><vte:if test="{PAGE_TITLE}"> - <vte:value select="{PAGE_TITLE}" /></vte:if></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Vivvo 4" />
<meta name="generation-time" content="$generation_time$" />
<link rel="search" type="application/opensearchdescription+xml" href="openSearch.php" title="{VIVVO_WEBSITE_TITLE}" />
{$meta_names__}
{$rss__}
[tag]
<!--[if IE lt 6]>
<link rel="stylesheet" type="text/css" href="ie-5.0+5.5.css" />
<![endif]-->
[/tag]
{$css__}
{$scripts__}
</head>
E também:
<head>
<base href="{VIVVO_PROXY_URL}" />
<title><vte:value select="{VIVVO_WEBSITE_TITLE}" /><vte:if test="{PAGE_TITLE}"> - <vte:value select="{PAGE_TITLE}" /></vte:if></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Vivvo 4" />
<meta name="generation-time" content="$generation_time$" />
<link rel="search" type="application/opensearchdescription+xml" href="openSearch.php" title="{VIVVO_WEBSITE_TITLE}" />
{$meta_names__}
{$rss__}
{$css__}
[tag]
<!--[if IE lt 6]>
<link rel="stylesheet" type="text/css" href="ie-5.0+5.5.css" />
<![endif]-->
[/tag]
{$scripts__}
</head>
Ou seja, antes e depois do {$css__} e infelizmente não carrega no IE6 de forma alguma. No Internet Explorer 8 funcionou normalmente.
Agradeço sua paciência, mas já estou quase desistindo. Acho que você tá ensinando certo e eu fazendo alguma coisa errada, mas não sei o quê.
#12
Posted 13/12/2008, 16:02
#13
Posted 13/12/2008, 17:24
#14
Posted 14/12/2008, 12:22
Edição feita por: Édipo Costa Rebouças, 14/12/2008, 12:22.
#15
Posted 14/12/2008, 18:20
Com relação ao template baixei da net e estou usando uma versão trial de 21 dias. Pois preciso testar primeiro pra poder ver se atende minhas necessidades.
Edição feita por: Pampa, 14/12/2008, 18:54.
0 user(s) are reading this topic
0 membro(s), 0 visitante(s) e 0 membros anônimo(s)