Co změnit v .haccess na hostingu?

Místo pro dotazy a rady ohledně programovacích jazyků (C++, C#, PHP, ASP, Javascript, VBS..) a tvorby webových stránek

Moderátor: Mods_senior

Uživatelský avatar
.:M@rt!n:.
Level 2
Level 2
Příspěvky: 227
Registrován: červen 11
Pohlaví: Muž
Stav:
Offline

Co změnit v .haccess na hostingu?

Příspěvekod .:M@rt!n:. » 10 led 2013 11:06

Ahoj,
nahrávám web na hosting "bazchem.cz" a mám problém s .htaccess souborem. Prosím o radu co v něm změnit aby mě na hostingu šel mod_rewrite? Takto vypadá .htaccess na localu, kde vše funguje:

Kód: Vybrat vše

# In case you want to add a .htpasswd authentification
# you'll have to add the host of the shop as an allowed entity,
# so that calls from the host skip the authentification
# Example:
# Order Deny,Allow
# Deny from All
# AuthType Basic
# AuthName "Access not allowed"
# AuthUserFile path_to_htpasswd_file/.htpasswd
# Require valid-user
# Allow from localhost
# Satisfy Any

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase  /Bazchem

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]

RewriteCond %{REQUEST_URI} oxseo\.php$
RewriteCond %{QUERY_STRING} mod_rewrite_module_is=off
RewriteRule oxseo\.php$ oxseo.php?mod_rewrite_module_is=on [L]

RewriteCond %{REQUEST_URI} !(\/admin\/|\/core\/|\/export\/|\/modules\/|\/out\/|\/setup\/|\/tmp\/|\/views\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !(\.html|\/|\.jpg|\.css|\.pdf|\.doc|\.gif|\.png|\.js|\.htc)$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{REQUEST_URI} !(\/admin\/|\/core\/|\/export\/|\/modules\/|\/out\/|\/setup\/|\/tmp\/|\/views\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (\.html|\/)$ oxseo.php


RewriteCond %{REQUEST_URI} (\/out\/pictures\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (\.jpe?g|\.gif|\.png)$ core/utils/getimg.php

</IfModule>

# disabling log file access from outside
<FilesMatch "(EXCEPTION_LOG\.txt|\.log$|\.tpl$|pkg\.rev)">
order allow,deny
deny from all
</FilesMatch>

Options -Indexes
DirectoryIndex index.php index.html



Díky za radu
MB MSI Z77A-G43 / procesor Intel Core i5-3570/ grafika MSI N660Ti PE 2GD5/OC / RAM Corsair 8GB KIT DDR3 1600MHz CL8 Vengeance / SSD disk OCZ Vertex 4 Series 128GB / zdroj Corsair CX600

Reklama
Uživatelský avatar
CZechBoY
Master Level 9.5
Master Level 9.5
Příspěvky: 8813
Registrován: srpen 08
Bydliště: Brno
Pohlaví: Muž
Stav:
Offline
Kontakt:

Re: Co změnit v .haccess na hostingu?

Příspěvekod CZechBoY » 10 led 2013 13:59

co znamená "nefunguje"?
PHP, Nette, MySQL, C#, TypeScript, Python
IntelliJ Idea, Docker, Opera browser, Linux Mint
iPhone XS
Raspberry PI 3 (KODI, Raspbian)
XBox One S, PS 4, nVidia GeForce NOW

Uživatelský avatar
.:M@rt!n:.
Level 2
Level 2
Příspěvky: 227
Registrován: červen 11
Pohlaví: Muž
Stav:
Offline

Re: Co změnit v .haccess na hostingu?

Příspěvekod .:M@rt!n:. » 10 led 2013 14:03

tzn
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, hostmaster@fugu.jed.cz and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
MB MSI Z77A-G43 / procesor Intel Core i5-3570/ grafika MSI N660Ti PE 2GD5/OC / RAM Corsair 8GB KIT DDR3 1600MHz CL8 Vengeance / SSD disk OCZ Vertex 4 Series 128GB / zdroj Corsair CX600

Uživatelský avatar
CZechBoY
Master Level 9.5
Master Level 9.5
Příspěvky: 8813
Registrován: srpen 08
Bydliště: Brno
Pohlaví: Muž
Stav:
Offline
Kontakt:

Re: Co změnit v .haccess na hostingu?

Příspěvekod CZechBoY » 10 led 2013 14:08

zakomentovat Options a DirectoryIndex
PHP, Nette, MySQL, C#, TypeScript, Python
IntelliJ Idea, Docker, Opera browser, Linux Mint
iPhone XS
Raspberry PI 3 (KODI, Raspbian)
XBox One S, PS 4, nVidia GeForce NOW

Uživatelský avatar
.:M@rt!n:.
Level 2
Level 2
Příspěvky: 227
Registrován: červen 11
Pohlaví: Muž
Stav:
Offline

Re: Co změnit v .haccess na hostingu?

Příspěvekod .:M@rt!n:. » 10 led 2013 14:11

Bohužel nepomohlo
MB MSI Z77A-G43 / procesor Intel Core i5-3570/ grafika MSI N660Ti PE 2GD5/OC / RAM Corsair 8GB KIT DDR3 1600MHz CL8 Vengeance / SSD disk OCZ Vertex 4 Series 128GB / zdroj Corsair CX600

Uživatelský avatar
CZechBoY
Master Level 9.5
Master Level 9.5
Příspěvky: 8813
Registrován: srpen 08
Bydliště: Brno
Pohlaví: Muž
Stav:
Offline
Kontakt:

Re: Co změnit v .haccess na hostingu?

Příspěvekod CZechBoY » 10 led 2013 14:14

posílej rovnou novej obsah ať vim jestli si to vůbec udělal správně

zkus eště dát pryč ten FilesMatch, ale to by snad problémy dělat nemělo

můžu se zeptat co to je za hosting?
PHP, Nette, MySQL, C#, TypeScript, Python
IntelliJ Idea, Docker, Opera browser, Linux Mint
iPhone XS
Raspberry PI 3 (KODI, Raspbian)
XBox One S, PS 4, nVidia GeForce NOW

Uživatelský avatar
.:M@rt!n:.
Level 2
Level 2
Příspěvky: 227
Registrován: červen 11
Pohlaví: Muž
Stav:
Offline

Re: Co změnit v .haccess na hostingu?

Příspěvekod .:M@rt!n:. » 10 led 2013 14:24

Tak ten FileMatch pomohl.
Teď ještě potřebuji povolit přístupová práva:

Kód: Vybrat vše

# In case you want to add a .htpasswd authentification
# you'll have to add the host of the shop as an allowed entity,
# so that calls from the host skip the authentification
# Example:
# Order Deny,Allow
# Deny from All
# AuthType Basic
# AuthName "Access not allowed"
# AuthUserFile path_to_htpasswd_file/.htpasswd
# Require valid-user
# Allow from localhost
# Satisfy Any

<IfModule mod_rewrite.c>
# Options +FollowSymLinks
RewriteEngine On
RewriteBase  /
   

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]

RewriteCond %{REQUEST_URI} oxseo\.php$
RewriteCond %{QUERY_STRING} mod_rewrite_module_is=off
RewriteRule oxseo\.php$ oxseo.php?mod_rewrite_module_is=on [L]

RewriteCond %{REQUEST_URI} !(\/admin\/|\/core\/|\/export\/|\/modules\/|\/out\/|\/setup\/|\/tmp\/|\/views\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !(\.html|\/|\.jpg|\.css|\.pdf|\.doc|\.gif|\.png|\.js|\.htc)$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{REQUEST_URI} !(\/admin\/|\/core\/|\/export\/|\/modules\/|\/out\/|\/setup\/|\/tmp\/|\/views\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (\.html|\/)$ oxseo.php


RewriteCond %{REQUEST_URI} (\/out\/pictures\/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (\.jpe?g|\.gif|\.png)$ core/utils/getimg.php

</IfModule>

# disabling log file access from outside


# Options -Indexes
# DirectoryIndex index.php index.html


Hosting je od firemního IT pracovníka
MB MSI Z77A-G43 / procesor Intel Core i5-3570/ grafika MSI N660Ti PE 2GD5/OC / RAM Corsair 8GB KIT DDR3 1600MHz CL8 Vengeance / SSD disk OCZ Vertex 4 Series 128GB / zdroj Corsair CX600

Uživatelský avatar
CZechBoY
Master Level 9.5
Master Level 9.5
Příspěvky: 8813
Registrován: srpen 08
Bydliště: Brno
Pohlaví: Muž
Stav:
Offline
Kontakt:

Re: Co změnit v .haccess na hostingu?

Příspěvekod CZechBoY » 10 led 2013 14:32

co znamená povolit přístupová práva?
login přes htpasswd nebo?
PHP, Nette, MySQL, C#, TypeScript, Python
IntelliJ Idea, Docker, Opera browser, Linux Mint
iPhone XS
Raspberry PI 3 (KODI, Raspbian)
XBox One S, PS 4, nVidia GeForce NOW

Uživatelský avatar
.:M@rt!n:.
Level 2
Level 2
Příspěvky: 227
Registrován: červen 11
Pohlaví: Muž
Stav:
Offline

Re: Co změnit v .haccess na hostingu?

Příspěvekod .:M@rt!n:. » 10 led 2013 14:34

Přístupová práva pro zápis do souborů... Je to nejak AllowOverride nebo tak nejak... Ale nevím kam to dát...
MB MSI Z77A-G43 / procesor Intel Core i5-3570/ grafika MSI N660Ti PE 2GD5/OC / RAM Corsair 8GB KIT DDR3 1600MHz CL8 Vengeance / SSD disk OCZ Vertex 4 Series 128GB / zdroj Corsair CX600

Uživatelský avatar
CZechBoY
Master Level 9.5
Master Level 9.5
Příspěvky: 8813
Registrován: srpen 08
Bydliště: Brno
Pohlaví: Muž
Stav:
Offline
Kontakt:

Re: Co změnit v .haccess na hostingu?

Příspěvekod CZechBoY » 10 led 2013 14:35

pokud nemáš práva na zápis do souborů tak máš špatně chmod a s tim nic htaccess neudělá
AllowOverride je tuším na přepisování adres přes mod_rewrite
PHP, Nette, MySQL, C#, TypeScript, Python
IntelliJ Idea, Docker, Opera browser, Linux Mint
iPhone XS
Raspberry PI 3 (KODI, Raspbian)
XBox One S, PS 4, nVidia GeForce NOW

Uživatelský avatar
.:M@rt!n:.
Level 2
Level 2
Příspěvky: 227
Registrován: červen 11
Pohlaví: Muž
Stav:
Offline

Re: Co změnit v .haccess na hostingu?

Příspěvekod .:M@rt!n:. » 10 led 2013 15:00

Dá se chmod nastavit nějak hromadně?
MB MSI Z77A-G43 / procesor Intel Core i5-3570/ grafika MSI N660Ti PE 2GD5/OC / RAM Corsair 8GB KIT DDR3 1600MHz CL8 Vengeance / SSD disk OCZ Vertex 4 Series 128GB / zdroj Corsair CX600

Uživatelský avatar
CZechBoY
Master Level 9.5
Master Level 9.5
Příspěvky: 8813
Registrován: srpen 08
Bydliště: Brno
Pohlaví: Muž
Stav:
Offline
Kontakt:

Re: Co změnit v .haccess na hostingu?

Příspěvekod CZechBoY » 10 led 2013 15:04

jestli máš přístup k tomu webu tak jo
stačí vzít tu root složku a nastavit jí práva a zaškrtnout něco jako nastavit práva rekurzivně, nevim jak je to teď přesně
PHP, Nette, MySQL, C#, TypeScript, Python
IntelliJ Idea, Docker, Opera browser, Linux Mint
iPhone XS
Raspberry PI 3 (KODI, Raspbian)
XBox One S, PS 4, nVidia GeForce NOW


Zpět na “Programování a tvorba webu”

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 6 hostů