URL: https://www.overclockers.at/linux/apache-umzug-von-subdirectory-auf-subdomain_254506/page_1 - zur Vollversion wechseln!
ich will meine ampache (läuft auf apache) url von domain.com/ampache auf ampache.domain.com umziehen. ich habe die ampache.conf angepasst:
ich habe aber offenbar noch ein problem mit meinen redirects, denn ampache.domain.com wird auf ampache.domain.com/ampache umgeleitet (und der server returned 404). ich kann zwar z.b. die login.php via ampache.domain.com/login.php aufrufen, die wird dann aber natürlich nicht richtig dargestellt und funktioniert auch nicht.Code:<VirtualHost *:80> ServerName ampache.domain.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html/ampache ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined RewriteEngine on RewriteCond %{SERVER_NAME} =ampache.domain.com RewriteRule ^ [url]https://%[/url]{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> ServerName ampache.domain.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html/ampache ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Include /etc/letsencrypt/options-ssl-apache.conf ServerName ampache.domain.com <IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains" </IfModule> SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem </VirtualHost> </IfModule>
/play/.htaccess:Code:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ^(.+)\.view$ /rest/index.php?ssaction=$1 [PT,L,QSA] RewriteRule ^fake/(.+)$ /play/$1 [PT,L,QSA] </IfModule>
/channel/.htaccess:Code:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ^art/([^/]+)/([^/]+)/([0-9]+)/thumb([0-9]*)\.([a-z]+)$ /image.php?object_type=$2&object_id=$3&auth=$1&thumb=$4&name=art.jpg [L] RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)(/.*)?$ /play/$5?$1=$2&$3=$4 [N,QSA] RewriteRule ^([^/]+)/([^/]+)(/.*)?$ /play/$3?$1=$2 [N,QSA] RewriteRule ^(/[^/]+|[^/]+/|/?)$ /play/index.php [L,QSA] </IfModule>
(es gibt noch ein paar andere, aber soweit ich gesehen habe stehen überall die gleichen RewriteCond und RewriteRule drin oder sachen die sich nicht auf urls beziehen)Code:<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ^([0-9]+)/(.*)$ /channel/index.php?channel=$1&target=$2 [PT,L,QSA] </IfModule>
Niemand hier der sich mit rewrites auskennt? Oder vielleicht liegt mein Problem ja wo anders?
Kann es sein, dass in deinen PHP Skripten auch Pfade und Domains in der Config gespeichert sind und die noch nicht geändert wurden?
Ich bin nicht der Apache Experte, kann da aber in den Regeln nichts falsches erkennen.
das wars! ich musste nur noch in der ampache config/ampache.cfg.php file die web_path variable auskommentieren. danke für den tipp! 
Code:; The public path to your ampache install ; Do not put a trailing / on this path ; For example if your site is located at [url]http://localhost[/url] ; than you do not need to enter anything for the web_path ; if it is located at [url]http://localhost/music[/url] you need to ; set web_path to /music ; DEFAULT: "" ;web_path = "/ampache"
Am besten du schaltest das Logging für Rewrites ein, dann kannst du sehr gut nachvollziehen, was hier passiert.
overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2025