Sevoir.hu

Ha nincs eltörve, ne ragaszd meg. - amerikai közmondás

Az oldalalom előzőleg GET paramtérekkel adtam át az oldalszámot [p],
vagy a kategórianézet nevét [cat], vagy a cimkík paramétereket; most ezt szebb formára hoztam egy megfelelő
.htaccess fájllal, amit a gyökér könyvtárba helyeztem.
Hátha segít neked is.
A http://www.sevoir.hu/?p=x linkeket átalakítja: http://www.sevoir.hu/node/x formátumra.
A http://www.sevoir.hu/?cat=xyz linkeket pedig: http://www.sevoir.hu/xyz formátumra.
A http://www.sevoir.hu/?tag=wy linkeket pedig: http://www.sevoir.hu/tag/wy formátumra.
Lehet nem a legszebb megoldás, de nekem működik.

Jelenlegi változat:

# Enable mod_rewrite, start rewrite engine
Options +FollowSymLinks
RewriteEngine on
#
# Internally rewrite search engine friendly static url to dynamic filepath and query
RewriteRule ^node/([^/]+)/?$ /index.php?p=$1 [L]
#
# Externally redirect client requests for old dynamic urls to equivalent new static urls
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php?p=([^&]+) HTTP/
RewriteRule ^index.php$ http://sevoir.hu/node/%1? [R=301,L]

RewriteRule ^/([^/]+)/?$ /index.php?cat=$1 [L]
RewriteCond %{THE_REQUEST} ^[A-Za-z]{3,9} /index.php?cat=([^&]+) HTTP/
RewriteRule ^index.php$ http://sevoir.hu/%1? [R=301,L]
RewriteRule ^ubuntu$ index.php?cat=ubuntu
RewriteRule ^blog$ index.php?cat=blog
RewriteRule ^addons$ index.php?cat=addons
RewriteRule ^fluxbox$ index.php?cat=fluxbox
RewriteRule ^letoltesek$ index.php?cat=letoltesek
RewriteRule ^kapcsolat$ index.php?cat=kapcsolat
RewriteRule ^php$ index.php?cat=php
RewriteRule ^gambas$ index.php?cat=gambas

RewriteRule ^tag/([^/]+)/?$ /index.php?tag=$1 [L]
RewriteCond %{THE_REQUEST} ^[A-Za-z]{3,9} /index.php?tag=([^&]+) HTTP/
RewriteRule ^index.php$ http://sevoir.hu/tag/%1? [R=301,L]

Nincs hozzászólás

Szóljon hozzá