fimoza85 Posted June 15, 2012 Report Share Posted June 15, 2012 (edited) Am o intrebare va rog. Am urmatorul cod in .htaccess<ifmodule mod_deflate.c> <filesmatch \.(css|html|js|php|xml)$> setoutputfilter deflate </filesmatch></ifmodule><ifmodule mod_security.c> secfilterengine off secfilterscanpost off</ifmodule><ifmodule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^www.fimoza.com RewriteRule (.*) http://fimoza.com/$1 [R=301,L] RewriteCond %{request_filename} -f RewriteRule ^(.*) $1 [L] RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]</ifmodule><ifmodule mod_expires.c> ExpiresActive On ExpiresDefault A0 <filesmatch \.(css|js|gif|jpe?g|png)$> ExpiresDefault A604800 </filesmatch> <filesmatch \.(html|xml)$> ExpiresDefault A10800 </filesmatch></ifmodule>FileEtag NoneOptions All -IndexesServerSignature OffErrorDocument 404 /errorIn special la linia asta cred ca trebuie sa lucrez RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]e vb despre filme , constructia linkului fara .htaccess este ex: http://fimoza.com/index.php?a=movie&q=120Si cu .htaccess access apare asa http://fimoza.com/movie/120/The+QuestBun.Acum eu am creat o alta constructie de denumita trailer, fara .htaccess este asa http://fimoza.com/index.php?a=trailer&b=120 intrebarea mea este urmatoarea, cum as putea sa fac aceasta contructie http://fimoza.com/index.php?a=trailer&b=120 sa apara in felul urmator http://fimoza.com/movie/120/The+Quest/trailer Edited June 15, 2012 by fimoza85 Quote Link to comment Share on other sites More sharing options...
robertutzu Posted June 15, 2012 Report Share Posted June 15, 2012 e regex daca nu ma insel userul wvw stie regex parca vb cu el poate te ajuta Quote Link to comment Share on other sites More sharing options...
Cril Posted June 15, 2012 Report Share Posted June 15, 2012 Am o intrebare va rog. Am urmatorul cod in .htaccess<ifmodule mod_deflate.c> <filesmatch \.(css|html|js|php|xml)$> setoutputfilter deflate </filesmatch></ifmodule><ifmodule mod_security.c> secfilterengine off secfilterscanpost off</ifmodule><ifmodule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^www.fimoza.com RewriteRule (.*) http://fimoza.com/$1 [R=301,L] RewriteCond %{request_filename} -f RewriteRule ^(.*) $1 [L] RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]</ifmodule><ifmodule mod_expires.c> ExpiresActive On ExpiresDefault A0 <filesmatch \.(css|js|gif|jpe?g|png)$> ExpiresDefault A604800 </filesmatch> <filesmatch \.(html|xml)$> ExpiresDefault A10800 </filesmatch></ifmodule>FileEtag NoneOptions All -IndexesServerSignature OffErrorDocument 404 /errorIn special la linia asta cred ca trebuie sa lucrez RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]e vb despre filme , constructia linkului fara .htaccess este ex: http://fimoza.com/index.php?a=movie&q=120Si cu .htaccess access apare asa The Quest (1996)Bun.Acum eu am creat o alta constructie de denumita trailer, fara .htaccess este asa http://fimoza.com/index.php?a=trailer&b=120 intrebarea mea este urmatoarea, cum as putea sa fac aceasta contructie http://fimoza.com/index.php?a=trailer&b=120 sa apara in felul urmator http://fimoza.com/movie/120/The+Quest/trailerTu ai :fimoza.com/index.php?a=trailer&b=120si in .htaccess ai :RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]inlocuieste q cu b in .htaccess Quote Link to comment Share on other sites More sharing options...
fimoza85 Posted June 15, 2012 Author Report Share Posted June 15, 2012 Tu ai :fimoza.com/index.php?a=trailer&b=120si in .htaccess ai :RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]inlocuieste q cu b in .htaccessAm inteles grate, dar nu merge asa, chiar daca am sa inlocuiesc q cu b am sa am urmatorul link fimoza.com/trailer/303/avatar intelegi ? imi trebuie sa fie fimoza.com/movie/303/avatar/trailer RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&[b]q[/b]=$3 [L]([a-z]+) <- asta este numele linkului creat, de la acel $1&, preia numele, linia asta RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L] e deja construita am explicat mai sus , functioneaza, apare in felu urmator fimoza.com/movie/303/avatart si eu acum vreau sa fac in .htaccess sa apara in exemplu dat mai sus Quote Link to comment Share on other sites More sharing options...