PDA

Zobacz pełną wersję : adresy htm



rado85
15-03-2015, 06:12
Witam,

mam do przeniesienia starą stronę, pisaną w samym html`u. i tam są zastosowane adresy .htm. Żeby nie tracić SEO warto by zachować te adresy.
Mam pytanie, skoro joomla oferuje dopisywanie html do adresu url to jak zmienic żeby dopisywało się tylko htm ?

morphic
15-03-2015, 23:27
A spróbuj w .htaccess dopisać linię:

RewriteRule ^(.*)\.html$ $1.htm [R=301,L]

rado85
15-03-2015, 23:37
Dzieki za odpowiedź.
Niestety nie działa.

mam albo bład 500 (500 - Nie znaleziono widoku [nazwa, typ, przedrostek]: article, htm, contentView)
a że używam Gantry to jest jeszcze:
Fatal error: Class 'JModuleHelper' not found in /promax/libraries/gantry/core/renderers/gantrymodulesrenderer.class.php on line 60

morphic
19-03-2015, 15:40
a spróbuj tak:
RewriteRule ^(.+)\.html$ $1.htm [L]

rado85
19-03-2015, 15:52
Dzięki, ale niestety nic to nie daje :(

mjmartino
20-03-2015, 19:00
Spróbuj tego ;)

RedirectMatch 301 (.*)\.html$ http://www.twojastrona.com/$1.htm
Chodź moim zdanie powinno być odwrotnie htm na html ale ja tam specjalistą w tych sprawach nie jestem.

rado85
20-03-2015, 21:32
nie działa. nic się nie dzieje. jak wklepuje adres z html to jest bład 500.

a gdie to joomla ma ustawione? gdzies w bazie może? lbo w pliku konfiguacyjnym? no nie da się podmienić html na htm ?

mjmartino
20-03-2015, 23:02
na pewno masz .htaccess ?
zahaszuj

#Options +FollowSymlinks
#Options -Indexes

Zawsze możesz się zwrócić do hostingodawcy jak ma niestandardową konfiguracje lub być może zabrania pewnych dyrektyw.
Zapytać zawsze można support.

rado85
21-03-2015, 22:56
Cześć,
mam taki kod:

hashowanie też nic nie daje.

##
# @package Joomla
# @copyright Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
# @license GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
#Options +FollowSymLinks

########## Begin - ETag Optimization
## This rule will create an ETag for files based only on the modification
## timestamp and their size.
## Note: It may cause problems on your server and you may need to remove it
FileETag MTime Size
# AddOutputFilterByType is now deprecated by Apache. Use mod_filter in the future.
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript


RewriteEngine On
RedirectMatch 301 (.*)\.html$ http://kacprzak.istronywww.pl/$1.htm
## 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 base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a ********** tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%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})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.

## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

# RewriteBase /

## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.



testowo uruchomiłem witrynę kacprzak.istronywww.pl

mac
22-03-2015, 20:20
Nie wiem czy nie przesadzasz, jak dobrze otagujesz stronę, dodasz wszystkie opisy jak na starej, dodasz mapę do googla, włączysz analitycsy to spokojnie nic nie stracisz