Stránka 1 z 2

Co změnit v .haccess na hostingu?

Napsal: 10 led 2013 11:06
od .:M@rt!n:.
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

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

Napsal: 10 led 2013 13:59
od CZechBoY
co znamená "nefunguje"?

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

Napsal: 10 led 2013 14:03
od .:M@rt!n:.
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.

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

Napsal: 10 led 2013 14:08
od CZechBoY
zakomentovat Options a DirectoryIndex

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

Napsal: 10 led 2013 14:11
od .:M@rt!n:.
Bohužel nepomohlo

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

Napsal: 10 led 2013 14:14
od CZechBoY
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?

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

Napsal: 10 led 2013 14:24
od .:M@rt!n:.
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

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

Napsal: 10 led 2013 14:32
od CZechBoY
co znamená povolit přístupová práva?
login přes htpasswd nebo?

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

Napsal: 10 led 2013 14:34
od .:M@rt!n:.
Přístupová práva pro zápis do souborů... Je to nejak AllowOverride nebo tak nejak... Ale nevím kam to dát...

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

Napsal: 10 led 2013 14:35
od CZechBoY
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

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

Napsal: 10 led 2013 15:00
od .:M@rt!n:.
Dá se chmod nastavit nějak hromadně?

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

Napsal: 10 led 2013 15:04
od CZechBoY
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ě