- Home
- Categorie
- Digital Marketing
- Posizionamento Nei Motori di Ricerca
- errore nel file htaccess?
-
errore nel file htaccess?
Ciao a tutti, ho un problema che mi sta facendo impazzire.
Vorrei implementare un sito di video sharing e sto utilizzando un cms che fa proprio questo, ma se ad esempio apro il link www-videonair-com/videos da errore 404 ma se invece aggiungo al link www-videonair-com/videos.php o tutte le altre pagine lincate sulle home aggiungendo il suffisso .php funziona tutto.
Il problema credo che sia sulle impostazioni del mod rewrite perchè ci sono molti altri siti che utilizzano il cms implementato sul mio dominio e funzionano correttamente senza il suffisso .php alla fine dei link.
Allego il file .htaccess ed il file loader.php e chiedo se qualcuno sa una soluzione. Aiutooohtaccess
# Comment the 2 lines below if the server returns 500 errors! # Options -Indexes # Options +FollowSymLinks #Uncomment following lines if you want to use image caching! <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A1209600 ExpiresByType text/html A1 </IfModule> # Uncomment following lines if Apache doesnt support MultiViews! <IfModule mod_rewrite.c> RewriteEngine On # Uncomment the 2 lines below if you are using www-domain-com # as the baseurl for the site and users access your site # via domain.com (THIS IS REQUIRED FOR JQUERY TO WORK) RewriteCond %{HTTP_HOST} ^videonair.com RewriteRule ^(.*)$ h t t p : / / www-videonair-com/$1 [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* loader.php [L,QSA] </IfModule> # Edit below lines and set to # ErrorDocument CODE /RELATIVE/error.php # If the script is installed in the default document # root then relative is null. #ErrorDocument 401 /error.php 403 /error.php 404 /error.php
file loader.php
<?php //die('Only enable this script if you dont have support for MultiViews'); $relative = ''; $loaders = array( 'ajax' => 1, 'album' => 1, 'albums' => 1, 'blog' => 1, 'blogs' => 1, 'captcha' => 1, 'categories' => 1, 'community' => 1, 'confirm' => 1, 'error' => 1, 'feedback' => 1, 'feeds' => 1, 'game' => 1, 'games' => 1, 'index' => 1, 'invite' => 1, 'loader' => 1, 'login' => 1, 'logout' => 1, 'lost' => 1, 'mail' => 1, 'notice' => 1, 'notices' => 1, 'photo' => 1, 'requests' => 1, 'search' => 1, 'signup' => 1, 'static' => 1, 'stream' => 1, 'upload' => 1, 'user' => 1, 'users' => 1, 'video' => 1, 'videos' => 1, 'edit' => 1 ); $query = ( isset($_SERVER['QUERY_STRING']) ) ? $_SERVER['QUERY_STRING'] : NULL; $request = str_replace($relative, '', $_SERVER['REQUEST_URI']); $request = str_replace('?' .$query, '', $request); $request = explode('/', trim($request, '/')); if (isset($request['0'])) { $page = $request['0']; if (isset($loaders[$page])) { require $page. '.php'; } else { header('HTTP/1.0 404 Not Found'); die(); } } else { header('HTTP/1.0 404 Not Found'); die(); } ?>