teobalds Posted May 5, 2009 Report Share Posted May 5, 2009 Vai kāds zin, kā ar mod rewrite var jūzeri veiksmīgi uz lapas indexu aizmest? RewriteRule ^page/([^/\.]+)/?$ index_test.php?page=$1 [L] ko var patraucēt ar šādu rewrite ruli swf ielādei - man šitādu prieku darbinot, sāka lamāties, ka nav AC_RunActiveContent.js vairs pieejams, mēģinot browserī palaist URLi www.somedemen.lv/page/? Quote Link to comment Share on other sites More sharing options...
Val Posted May 6, 2009 Report Share Posted May 6, 2009 kāds ceļs norādīts uz to .js failu un kur tas reāli atrodas? Quote Link to comment Share on other sites More sharing options...
web-dev.lv Posted May 6, 2009 Report Share Posted May 6, 2009 es ieteiktu šādu risinājumu RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif|jpeg) RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^page/([^/\.]+)/?$ index_test.php?page=$1 [QSA,L] Quote Link to comment Share on other sites More sharing options...
marcis Posted May 6, 2009 Report Share Posted May 6, 2009 Priekškam tev šo rindiņu RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif|jpeg) ? Vienīgais, ko viņa darīs, būs - Error 404, jo RewriteCond %{REQUEST_FILENAME} !-f rindiņa pati par sevi norāda, ka ja eksistē fails, tad rewrite tiek pārtraukts. Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted May 9, 2009 Report Share Posted May 9, 2009 (edited) Parasti ja kabina klāt to .js failu, tad piemēram ja index.php ir pamata fails, blakus tam stāv kāda mape kurā atrodas .js fails, piemeram "asdasdas", tad index failā .js faila piekabinājuma adresei jābūt attiecīgi asdasdas/failanosaukums.js neatkarīgi no citiem failiem. Ja piemēram index.php includē kādu citu php failu, teiksim kura direktorija ir asdasdas/mape/mape2/fails.php tad vienalga adrese paliek tāda pati - asdasdas/failanosaukums.js Edited May 9, 2009 by MCWeb.lv Quote Link to comment Share on other sites More sharing options...
marcis Posted May 10, 2009 Report Share Posted May 10, 2009 (edited) Un vienāds efekts nebūs abos gadījumos, imo? Tb rewrite'ojot un nerewrite'ojot .js pieparasījumus? Edited May 10, 2009 by marcis Quote Link to comment Share on other sites More sharing options...
Cibiņš Posted May 10, 2009 Report Share Posted May 10, 2009 Priekškam jārewritē tie js? Nezinu ar .htaccessu neņemos taisu visu savādāk, ar php pārrakstu adreses, ar .htacessu ķēpas bieži ir. Quote Link to comment Share on other sites More sharing options...
marcis Posted May 10, 2009 Report Share Posted May 10, 2009 (edited) Kurš posts no manis šajā topikā par to, ka RewriteCond %{REQUEST_FILENAME} !-f un RewriteCond %{REQUEST_URI} !\.(css|js|jpg|gif|jpeg) rada pilnīgi vienādu efektu? Edited May 10, 2009 by marcis 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.