dAivEd Posted May 26, 2009 Report Share Posted May 26, 2009 Labdien, vai kāds nevarētu palīdzēt uztaisīt ar RewriteEngine tā lai būtu piemēram: domain.lv/lietotājs un vinsh paņem no datubāzes lietotāju kurš ir norādīts pec sleša ? Quote Link to comment Share on other sites More sharing options...
marcis Posted May 26, 2009 Report Share Posted May 26, 2009 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^[A-Za-z0-9\-_\.]+$ /index.php?user=$1 echo $_GET['user']; Pirms tam gan vajadzētu definēt arī sistēmas ceļus. Quote Link to comment Share on other sites More sharing options...
Web Developer Posted May 26, 2009 Report Share Posted May 26, 2009 labāk rewraitot universālāku variabli, piemēram, "q" vai "path": index.php?q=$1, index.php?path=$1 Un tad to variabli analizēt to savā skriptā. Vai arī varbūt uzreiz izmanto MVC patternu. Quote Link to comment Share on other sites More sharing options...
marcis Posted May 26, 2009 Report Share Posted May 26, 2009 Ideja bija tāda - izveido vēl vajadzīgos sistēmas RewriteRul'us ar [L] flagu. Tad arī mainīgajam $_GET['user'] nebūtu nekādas vainas. Quote Link to comment Share on other sites More sharing options...
dAivEd Posted May 27, 2009 Author Report Share Posted May 27, 2009 RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^[A-Za-z0-9\-_\.]+$ /index.php?user=$1 echo $_GET['user']; Pirms tam gan vajadzētu definēt arī sistēmas ceļus. izvada tukshumu ;( Quote Link to comment Share on other sites More sharing options...
marcis Posted May 27, 2009 Report Share Posted May 27, 2009 Jā, jo ([A-Za-z0-9\-_\.]+) jāliek iekavās :) 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.