2017-07-03 1 views
0

J'ai une tâche - tous somestuff.html/pages avec barre oblique doit rediriger vers somestuff.html et toutes les autres pages sans une barre oblique doivent rediriger pour ajouter une barre oblique finale (par exemple/must mypage rediriger vers/mypage /). J'ai accompli la tâche mais maintenant/administrateur/page renvoie la page 404. J'ai essayé d'exclure le/administrateur/page, mais sa ne fonctionne pas:redirections htaccess affecter la page administrateur sur Joomla

DirectoryIndex index.php 
RewriteEngine on 
RewriteBase/

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] 
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

#this part breaks the admin panel entry 

RewriteRule ^([^.]+).html/ http://somedomain.com/$1\.html [R=301,L] 
RewriteCond %{REQUEST_URI} !\.(php|html?|jpg|gif)$ 

#trying to exclude administrator page 
RewriteCond %{REQUEST_URI} !^/administrator/ 

RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301] 

#end of part that breaks the admin panel entry 

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] 

Quelqu'un peut-il me dire ce que je fais mal ou peut-être offrir une autre solution pour acocmplish la redirection. Merci.

Répondre

0

trouvé une solution:

DirectoryIndex index.php 
RewriteEngine on 
RewriteBase/

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] 
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] 
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^([^.]+).html/ http://logosstudy.ru/$1\.html [R=301,L] 
RewriteCond %{REQUEST_URI} !^/administrator/ 
RewriteCond %{REQUEST_URI} !\.(php|html?|jpg|gif)$ 
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301] 
RewriteCond %{REQUEST_URI} !^/administrator/ 
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]