keiG Posted December 13, 2013 Report Share Posted December 13, 2013 Sveiki! Vēršos šeit, jo htaccess tik labi nepārzinu. ideja ir apvienot url normālformu ar seo formu tātad šeit ir esošais htaccess RewriteEngine on RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2&id=$3&id2=$4 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2&id=$3 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2 [L] RewriteRule ^([^/\.]+)/?$ index.php?lang=$1 [L] Vēlamā rezultāta piemērs: Ar esošo htaccess seo formā viss kas sākās ar ? netiek ņemts vērā. Esmu redzējis vairākām lapām šādu lietu, bet pašam uzrakstīt neizdevās. Nepieciešams priekš google kampaņu statistikas. Netā meklēju, bet neko konkrētu neatradu. Ir kādas idejas? Quote Link to comment Share on other sites More sharing options...
keiG Posted December 13, 2013 Author Report Share Posted December 13, 2013 Nu ko tomēr atradu! RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2&id=$3&method=$4 [L,QSA] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2&id=$3 [L,QSA] RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?lang=$1&page=$2 [L,QSA] RewriteRule ^([^/\.]+)/?$ index.php?lang=$1 [L,QSA] Tad varbūt kādam noderēs :) Quote Link to comment Share on other sites More sharing options...
anonīms Posted December 16, 2013 Report Share Posted December 16, 2013 Un ar miljons dažādiem linkiem un sublinkiem aizdirsīsi lieki htaccess. Man personīgi ir šāds: # Rewrite current-style URLs of the form 'index.php?q=x'. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] Quote Link to comment Share on other sites More sharing options...
aaxc Posted December 16, 2013 Report Share Posted December 16, 2013 Es arī izmantoju drupal ģenerēto ar full over-ride: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> Pārējo jau mans scripts ar db ierakstiem apstrādā. Quote Link to comment Share on other sites More sharing options...
jurchiks Posted December 16, 2013 Report Share Posted December 16, 2013 (edited) Es pagaidām rūtējot iztieku bez db pieprasījumiem, bet man arī .htaccess ir vienkāršs: RewriteEngine on RewriteCond %{REQUEST_URI} !^/images/ RewriteCond %{REQUEST_URI} !^/css/ RewriteCond %{REQUEST_URI} !^/js/ RewriteCond %{REQUEST_URI} !robots.txt RewriteCond %{SCRIPT_FILENAME} !index.php RewriteRule .* ./index.php [L] Nesaprotu tos cilvēkus, kuri rewraito request path uz GET parametru. Priekš kam, ja var apstrādāt reālo REQUEST_URI? Edited December 16, 2013 by jurchiks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.