Portál AbcLinuxu, 4. května 2024 14:23
Ahoj, mám problém, že mě vůbec nefunguje rewrite...
Povolil jsem modul "rewrite.load"
ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
Povolil jsem modul "vhost_alias.load"
ln -s /etc/apache2/mods-available/vhost_alias.load /etc/apache2/mods-enabled/
Restartoval jsem Apache2
/etc/init.d/apache2 restart
V konfiguraci Apache2 mám
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Soubor htaccess mám v adresáři /var/www/
RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ ?seo_1=$1 [L,QSA]
Neporadí někdo znalý oboru, Děkuji
Řešení dotazu:
htaccess
, ale .htaccess
(tečka na začátku).
error log mi píše jen tohle
[Tue May 15 11:24:07 2012] [error] [client xx.xx.xx.xx] File does not exist: /var/www/list, referer: http://xx.xx.xx.xx/pořád to hledá adresář list, přitom by se měl načíst jen index.php a obsah "list" by měla být v $_GET['seo_1'] čili
echo $_GET['seo_1']; by měla vypsat list.
RewriteRule ^([a-z]+)/?$ index.php?seo_1=$1 [L,QSA]
Problém byl tady
AllowOverride None má tam být AllDíky všem za pomoc
AllowOverride FileInfo Options
Tiskni Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.