PDA

Zobacz pełną wersję : Ustawienia -> Translacja URL



brzoza
20-02-2008, 13:16
Cześć,

Chciałbym sobie uruchomić w serwisie tzw. "przyjazne" :-) urle. Jak wiadomo wchodzi to w skład standardowej funkcjonalności Joomla, z koniecznością zmiany nazwy pliku htaccess...

Tymczasem w mojej firmie hostingowej (ACTIVE24) jest to w jakiś sposób zablokowane - serwer ignoruje ten plik. Polecono mi, abym dostarczył im regułki mod_rewrite, to dokonają stosownych zmian z poziomu głównego administratora.

Będę wdzięczny za informację co mam im dokładnie przekazać? Zakładam, że plik htaccess... cały? jaki fragment?

Dzięki za pomoc.
Pozdrawiam.

inkos
20-02-2008, 13:34
Będę wdzięczny za informację co mam im dokładnie przekazać? Zakładam, że plik htaccess... cały? jaki fragment?
Poszukaj na forum stosowne informacje są w kilku wątkach. Podaj im cały plik.

brzoza
21-02-2008, 23:15
Cześć,

Koontynuuję wątek, bo sprawa ma dalszy ciąg, problemik, choć inny - jest nadal związany z chęcią uruchomienia translacji URL...

...otóż administratorzy serwera włączyli mi htacces'y, odtąd plik .htaccess nie jest ignorowany, lecz normalnie są wykonywane wszystkie znajdujące się w nim polecenia. Ucieszyłem się bardzo, wziąłem z pakietu instalacyjnego plik htaccess.txt, zmieniłem nazwę i wysłałem na serwer. Zawartość oczywiście zupełnie nie tykana... no i przy wejsciu na serwis pojawił mi się taki komunikat:

===
Błąd serwera!
Serwer napotkał błąd wewnętrzny i nie jest w stanie zrealizować twojego żądania. Serwer jest przeciążony lub napotkał na błąd w skrypcie CGI.
Jeśli myślisz, że jest to błąd tego serwera, skontaktuj się z administratorem.

Error 500
www.e-gory.pl (http://www.e-gory.pl/)
Apache
===


Ktoś z Was orientuje się co może być przyczyną?


Informacje o systemie
PHP działa na: Linux s108 2.6.17-5mdv #1 SMP
Wersja MySQL: 5.0.37-log
Wersja PHP: 5.1.6
Serwer WWW: Apache
Interfejs serwera PHP: apache2handler
Wersja Joomla!: 1.0.11 Stable

pozdr.

inkos
21-02-2008, 23:47
Cześć,

Koontynuuję wątek, bo sprawa ma dalszy ciąg, problemik, choć inny - jest nadal związany z chęcią uruchomienia translacji URL...

...otóż administratorzy serwera włączyli mi htacces'y, odtąd plik .htaccess nie jest ignorowany, lecz normalnie są wykonywane wszystkie znajdujące się w nim polecenia. Ucieszyłem się bardzo, wziąłem z pakietu instalacyjnego plik htaccess.txt, zmieniłem nazwę i wysłałem na serwer. Zawartość oczywiście zupełnie nie tykana... no i przy wejsciu na serwis pojawił mi się taki komunikat:

===
Błąd serwera!
Serwer napotkał błąd wewnętrzny i nie jest w stanie zrealizować twojego żądania. Serwer jest przeciążony lub napotkał na błąd w skrypcie CGI.
Jeśli myślisz, że jest to błąd tego serwera, skontaktuj się z administratorem.

Error 500
www.e-gory.pl (http://www.e-gory.pl/)
Apache
===


Ktoś z Was orientuje się co może być przyczyną?


Informacje o systemie
PHP działa na: Linux s108 2.6.17-5mdv #1 SMP
Wersja MySQL: 5.0.37-log
Wersja PHP: 5.1.6
Serwer WWW: Apache
Interfejs serwera PHP: apache2handler
Wersja Joomla!: 1.0.11 Stable

pozdr.
Polecam dalszy kontakt z Twoim administratorem. Przekaż mu te informacje które opublikowałeś na forum.

brzoza
22-02-2008, 16:32
OK, więc kontaktowałem się z adminami i... nadal mam problem:

- mod_rewrite uruchomiony
- plik .htaccess na serwerze (jego obecność nie powoduje już błędu 500)
- w konfiguracji CMS Joomla ustawiona translacja url

I przy próbie wejścia w dowolny link (już sprowadzony do prostej postaci) wyświetla bład 404.

Admini serwera mówią, że przyczyną jest błędna konfiguracja w .htaccess, poniżej plik, Czy ktoś z Was mógłby rzucić okiem i ewentualnie wskazać co jest nie tak?

Inna sprawa, że trochu to dziwne, że standardowy plik nie działa...




##
# @version $Id: htaccess.txt 4756 2006-08-25 16:07:11Z stingrey $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


################################################## ###
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options FollowSymLinks' may cause
# with some server configurations. It is required for use of
# be set by your server administrator in a way that dissallows changing
# your .htaccess file. If using it causes your server to error out,
# beginning of line), reload your site in your browser and test your sef
# it has been set by your server administrator and you do not need it
#
# Only use one of the two SEF sections that follow. Lines that can be
# (and thus used) have only one #. Lines with two #'s should not be
# In the section that you don't use, all lines should start with #
#
# For Standard SEF, use the standard SEF section. You can comment out
# all of the RewriteCond lines and reduce your server's load if you
# don't have directories in your root named 'component' or 'content'
#
# If you are using a 3rd Party SEF or the Core SEF solution
# uncomment all of the lines in the '3rd Party or Core SEF' section
#
################################################## ###

##### SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
#
# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
# May need to be uncommented. If you are running your Joomla/Mambo from
# a subdirectory the name of the subdirectory will need to be inserted
# line. For example, if your Joomla/Mambo is in a subdirectory called
# change this:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
# to this:
# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR]
##optional - see notes##
#
################################################## ###


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

#
# mod_rewrite in use

RewriteEngine On


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

# RewriteBase /


########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section



########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla!
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section



########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations
## This attempts to block the most common type of exploit `attempts` to
#
# 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 <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%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


Dzięki, pozdrawiam.

killaherz
26-08-2008, 11:30
OK, więc kontaktowałem się z adminami i... nadal mam problem:

- mod_rewrite uruchomiony
- plik .htaccess na serwerze (jego obecność nie powoduje już błędu 500)
- w konfiguracji CMS Joomla ustawiona translacja url

I przy próbie wejścia w dowolny link (już sprowadzony do prostej postaci) wyświetla bład 404.

Admini serwera mówią, że przyczyną jest błędna konfiguracja w .htaccess, poniżej plik, Czy ktoś z Was mógłby rzucić okiem i ewentualnie wskazać co jest nie tak?

Inna sprawa, że trochu to dziwne, że standardowy plik nie działa...




##
# @version $Id: htaccess.txt 4756 2006-08-25 16:07:11Z stingrey $
# @package Joomla
# @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##


################################################## ###
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options FollowSymLinks' may cause
# with some server configurations. It is required for use of
# be set by your server administrator in a way that dissallows changing
# your .htaccess file. If using it causes your server to error out,
# beginning of line), reload your site in your browser and test your sef
# it has been set by your server administrator and you do not need it
#
# Only use one of the two SEF sections that follow. Lines that can be
# (and thus used) have only one #. Lines with two #'s should not be
# In the section that you don't use, all lines should start with #
#
# For Standard SEF, use the standard SEF section. You can comment out
# all of the RewriteCond lines and reduce your server's load if you
# don't have directories in your root named 'component' or 'content'
#
# If you are using a 3rd Party SEF or the Core SEF solution
# uncomment all of the lines in the '3rd Party or Core SEF' section
#
################################################## ###

##### SOLVING PROBLEMS WITH COMPONENT URL's that don't work #####
# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED
# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING
#
# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
# May need to be uncommented. If you are running your Joomla/Mambo from
# a subdirectory the name of the subdirectory will need to be inserted
# line. For example, if your Joomla/Mambo is in a subdirectory called
# change this:
# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
# to this:
# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR]
##optional - see notes##
#
################################################## ###


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

#
# mod_rewrite in use

RewriteEngine On


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

# RewriteBase /


########## Begin - Joomla! core SEF Section
############# Use this section if using ONLY Joomla! core SEF
## ALL (RewriteCond) lines in this section are only required if you actually
## have directories named 'content' or 'component' on your server
## If you do not have directories with these names, comment them out.
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
RewriteRule ^(content/|component/) index.php
#
########## End - Joomla! core SEF Section



########## Begin - 3rd Party SEF Section
############# Use this section if you are using a 3rd party (Non Joomla!
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional
#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule (.*) index.php
#
########## End - 3rd Party SEF Section



########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations
## This attempts to block the most common type of exploit `attempts` to
#
# 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} (\<|%3C).*script.*(\>|%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


Dzięki, pozdrawiam.

Mam dokladnie identyczny problem. Czy ktos zna rozwiazanie ??

M_K_S
26-08-2008, 12:30
Mam dokladnie identyczny problem. Czy ktos zna rozwiazanie ??

Też mam ten problem. Co najdziwniejsze niektóre strony działają normalnie a inne wywalają 404;)

crazyluki
26-08-2008, 13:02
napiszcie dokładną specyfikację serwera, gdzie jest ten serwer i tak dalej. aha
i napiszcie czy to jest platny serwer:)

killaherz
26-08-2008, 13:11
serwer one.com, platny.
Kontaktowalem sie z administratorami serwera i stwierdzono ze wszystko powinno dzialac i ze prawdopodobnie jest blad w pliku htaccess.
Moj plik htaccess:

##
# @version $Id: htaccess.txt 10492 2008-07-02 06:38:28Z ircmaxell $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##

################################################## ###
# 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 -Indexes
# 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} (\<|%3C).*script.*(\>|%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 /

########## 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 ^(content/components) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
########## End - Joomla! core SEF Section

crazyluki
26-08-2008, 13:28
próbowałeś zakomentować
RewriteBase / ?

killaherz
26-08-2008, 13:37
wlasnie nie wiem co mam wpisac po slashu.
wiem ze tam sie podaje katalog w ktorym jest joomla. Ale ja mam w glownym katalogu.
Zakomentowalem i dalej jest to samo. moze bardziej rozwine swoj problem.

jezli ustawie:
Search Engine friendly URL - NO,
Use Apache mod_rewrite - YES,
Add suffix to URLs - YES.
Wszystko jest dobrze, ale SEF URL jest wylaczony.

jezeli ustawie:
Search Engine friendly URL - YES,
Use Apache mod_rewrite - YES,
Add suffix to URLs - YES.
Strona domowa sie odpala, ale jak klikne na jakikolwiek link wywala blad : "The webpage cannot be found Error 404".

jezeli ustawie:
Search Engine friendly URL - YES,
Use Apache mod_rewrite - NO,
Add suffix to URLs - NO.
Strona domowa wporzadku, ale po kliknieciu w dowolny link otwiera sie stronka, ale bez css'a.

crazyluki
26-08-2008, 16:41
Use Apache mod_rewrite - NO,

moim zdaniem jest jakiś problem z tym.generalnie jest łatwe rozwiązanie - zainstaluj sh404sef, on ma jedną opcją - sef without htaccess - dzięki temu Twoje linki będa miały w adresie (niestety) index.php/jakas/tam/strona.html ale będzie Ci wszystko działać bez najmniejszych problemów:)

killaherz
26-08-2008, 23:18
Jakby nie bylo ustawione: Use Apache mod_rewrite na tak czy na nie to dziala dobrze dopoki jest wylaczony SEF URL. Dopiero sie problem pojawia jak wlacze SEF URL.
Powtorze sie:
jezli ustawie:
Search Engine friendly URL - NO,
Use Apache mod_rewrite - YES,
Add suffix to URLs - YES.
Wszystko jest dobrze, ale SEF URL jest wylaczony.

jezeli ustawie:
Search Engine friendly URL - YES,
Use Apache mod_rewrite - YES,
Add suffix to URLs - YES.
Strona domowa sie odpala, ale jak klikne na jakikolwiek link wywala blad : "The webpage cannot be found Error 404".

jezeli ustawie:
Search Engine friendly URL - YES,
Use Apache mod_rewrite - NO,
Add suffix to URLs - NO.
Strona domowa wporzadku, ale po kliknieciu w dowolny link otwiera sie stronka, ale bez css'a.
Jak nie bedzie innego rozwiazania bede zmuszony zainstalowac sh404sef'a.
Moze ktos jednak zna rozwiazanie tego problemu ?

brzoza
31-08-2008, 08:25
napiszcie dokładną specyfikację serwera, gdzie jest ten serwer i tak dalej. aha
i napiszcie czy to jest platny serwer:)

Jak najbardziej płatny :-) polski, serwer - w Active24.pl
Admini serwera twierdzą, że po ixh stronie wszystko jest OK, zaś wg nich błąd jest w .htaccess CMS Joomla.

Pozdr.