Jump to content
fimoza85

ajutor .htaccess

Recommended Posts

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 None
Options All -Indexes
ServerSignature Off
ErrorDocument 404 /error

In 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=120

Si cu .htaccess access apare asa http://fimoza.com/movie/120/The+Quest

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/trailer

Edited by fimoza85
Link to comment
Share on other sites

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 None
Options All -Indexes
ServerSignature Off
ErrorDocument 404 /error

In 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=120

Si 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/trailer

Tu ai :

fimoza.com/index.php?a=trailer&b=120

si in .htaccess ai :

RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]

inlocuieste q cu b in .htaccess

Link to comment
Share on other sites

Tu ai :

fimoza.com/index.php?a=trailer&b=120

si in .htaccess ai :

RewriteRule ^([a-z]+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L]

inlocuieste q cu b in .htaccess

Am 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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...