WN

WN (https://www.wn.se/forum/index.php)
-   Off Topic (https://www.wn.se/forum/forumdisplay.php?f=7)
-   -   Sätta ihop en server, tips? (https://www.wn.se/forum/showthread.php?t=1057727)

MusikMixen 2013-05-01 16:10

Hur menar du med riktiga konfigfiler? Att jag skriver in det i själva apache.conf filen?

linusoleander 2013-05-01 18:58

Citat:

Ursprungligen postat av MusikMixen (Inlägg 20468915)
Hur menar du med riktiga konfigfiler? Att jag skriver in det i själva apache.conf filen?

Ja, eller domänspecifika konfig-filer som du sedan inkluderar i din apache.conf-fil.

Har själv aldrig riktigt förstått vad man ska med .htaccess-filer till om man ändå har tillgång till apache.conf

pelmered 2013-05-01 21:04

Ja, jag menade precis som linusoleander skrev ovan.

Här har du lite information om varför .htaccess är dåligt och varför Nginx inte har stöd för något liknande:
http://wiki.nginx.org/LikeApache-htaccess

MusikMixen 2013-05-01 22:46

Så här ser den ut nu:
Kod:

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 base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> 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 /
RewriteCond %{HTTP_HOST} ^musikmixen.se
RewriteRule (.*) http://www.musikmixen.se/$1 [R=301,L]

## 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 request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]
# 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.

AddType text/plain txt
AddType audio/mpeg mp3
AddType audio/x-mpegurl m3u
AddType audio/x-ms-wma wma
AddType audio/x-ms-wax wax
AddType video/x-ms-asf asf
AddType video/x-ms-asf asf asx
AddType video/x-ms-wmv wmv
AddType video/x-ms-wvx wvx
AddType video/x-ms-wmx wmx
AddType application/ogg ogm
AddType application/ogg ogg
AddType audio/x-pn-realaudio ram
AddType audio/x-pn-realaudio-plugin rpm
AddType audio/x-pn-realaudio ra
AddType audio/x-pn-realaudio rm
AddType audio/x-scpls pls

Hur sätter man in den i apache config filen?
Länka gärna till en svensk sida som beskriver det om ni inte själva gör det :)


Alla tider är GMT +2. Klockan är nu 02:26.

Programvara från: vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson