Sāku čakarēties ar pretty url.
Par piemēru, mēģinu šo http://pixelcode.co.uk/tutorials/webmaster/clean-urls-with-mod_rewrite/
Bet nestrādā. Izmet šādu erroru. https://prntscr.com/5osqip
Tāpēc pieļauju, kad manam vps serverim nav "ieslēgts" mod_rewrite modulis. Vai tā tas varētu būt?
Un kā es to varu pārbaudīt un varbūt varat ieteikt kaut ko?
Fukzzs miniblogs
- 0
Fukzzs 05.01.2015. 18:03
- 0
Laikam šis būs tas errors.
[Mon Jan 05 19:30:04 2015] [error] [client 46.109.227.237] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
- 0
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
<IfModule mod_rewrite.c>
RewriteRule ^([a-z]+)\/([0-9]+)\/?$ test.php?id=$1&id2=$2 [NC]
</IfModule>
test.php (Šis vienkārši no pamācības paņemtas)
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Clean URL with .htaccess by http://codeofaninja.com/</title>
</style>
</head>
<body>
<h1>Parameter: Letter and Number ONLY. This is parameter_letter_and_number.php</h1>
<?php
echo "PARAMETER VALUE 1: " . $_REQUEST['param'];
echo "<br />";
echo "PARAMETER VALUE 2: " . $_REQUEST['param2'];
?>
</body>
</html>
No šī lapa.lv/test?param=post¶m2=143
Mēģinu dabūt lapa.lv/test/post/143
Bet tad izmet šo https://prntscr.com/5osqipError
Un uzrādītais errors šeit
EDIT
[Mon Jan 05 19:30:04 2015] [error] [client 46.109.227.237] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
tagad vēl sāka rādīt šitos erroru[Mon Jan 05 19:27:25 2015] [error] [client 46.109.227.237] PHP Notice: Undefined index: param in /home/admin/web/lapa/public_html/test.php on line 13 [Mon Jan 05 19:27:25 2015] [error] [client 46.109.227.237] PHP Notice: Undefined index: param2 in /home/admin/web/lapa/public_html/test.php on line 15
- 0
Ok, man kaut kādā veidā sanāca tas, kad strādā - lapa.lv/test/1
Un lapā pamana šo<?php
echo "PARAMETER VALUE 1: " . $_REQUEST['param'];
echo "<br />";
echo "PARAMETER VALUE 2: " . $_REQUEST['param2'];
?>
Bet tagad izmantojot pretty url lapa.lv/test/1 lapa neizmanto manu css failu.
Mans .htaccess
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^([a-z]+)\/?$ $1.php [NC]
RewriteRule ^([a-z]+)\/([0-9]+)\/?$ test.php?param=$1¶m2=$2 [NC]
</IfModule>
Ielogojies vai izveido profilu, lai komentētu!