Jump to content
php.lv forumi

.htaccess


kalabox

Recommended Posts

Sveiki, saskāros ar kaut kādu kļūdu.. Noņēmu lapu no maksas hosta uzliku uz PC.. Uzinstalēst xampp..

 

 

un tiklīdz pievienoju htaccess failu tā met ārā 500 erroru..

 

#AddDefaultCharset UTF-8
#php_value magic_quotes_gpc off
# Iedarbina modrewrite
RewriteEngine on
Options +FollowSymLinks
#RewriteBase /

RewriteRule ^punkt([0-9]+)/?$ index.php?m=grup&k=$1 [QSA,L]
RewriteRule ^page([0-9]+).html$ index.php?m=stat&k=$1 [QSA,L]
#meklēšana pēc rakstiem
RewriteRule ^stpoisk/?$ index.php?m=stpoisk [QSA,L]
#Noteikumi apgabala meklējumiem
RewriteRule ^metka/(.*)/$ index.php?m=setmetka&k=$1 [QSA,L]
RewriteRule ^registr/?$ index.php?m=registr [QSA,L]
RewriteRule ^registr/exitavt/?$ index.php?m=registr&exitavt=on [QSA,L]
RewriteRule ^registr/inforeg/?$ index.php?m=registr&inforeg=on [QSA,L]
RewriteRule ^registr/regrepair/?$ index.php?m=registr&regrepair=on [QSA,L]
RewriteRule ^registr/user([0-9]+).html$ index.php?m=registr&showuser=$1 [QSA,L]
RewriteRule ^registr/enter/?$ index.php?m=registr&enter=on [QSA,L]
RewriteRule ^modcom/(.*)$ index.php?m=canmailcom&k=$1 [QSA,L]

RewriteRule ^guest/?$ index.php?m=guest [QSA,L]
RewriteRule ^guest/([0-9]+).html$ index.php?m=guest&guestpage=$1 [QSA,L]

RewriteRule ^news/?$ index.php?m=news [QSA,L]
RewriteRule ^news/([0-9]+).html$ index.php?m=news&newspage=$1 [QSA,L]
RewriteRule ^news/arhiv/?$ index.php?m=news&newsarhiv=on [QSA,L]
RewriteRule ^news/arhiv/([0-9]+).html$ index.php?m=news&newsarhiv=on&newspage=$1 [QSA,L]

RewriteRule ^photo/?$ index.php?m=photogallery [QSA,L]
RewriteRule ^photo/gallery([0-9]+)/?$ index.php?m=photogallery&catphoto=$1 [QSA,L]
RewriteRule ^subscribe/?$ index.php?m=subscribe [QSA,L]
RewriteRule ^subscribe/deletsub.html$ index.php?m=subscribe&deletsub=on [QSA,L]

RewriteRule ^redbanner/bn([0-9]+).html$ moduls/banners/redirectbn.php?ban=$1 [QSA,L]
RewriteRule ^redbanner/ / [R=301,L]

RewriteRule ^qonline/?$ index.php?m=qonline [QSA,L]



#RewriteRule ^doskaadv/?$ index.php?m=doska [QSA,L]

RewriteRule ^newadv/?$ index.php?m=doska&k=addadvert [QSA,L]
RewriteRule ^category([0-9]+)/?$ index.php?m=doska&k=podcategory&podcategory=$1 [QSA,L]
RewriteRule ^category([0-9]+)/num([0-9]+)\.html index.php?m=doska&k=podcategory&podcategory=$1&page_podcat=$2 [QSA,L]
RewriteRule ^advert([0-9]+)\.html index.php?m=doska&k=advert&advert=$1 [QSA,L]
RewriteRule ^alladv/?$ index.php?m=doska&k=all_advert [QSA,L]
RewriteRule ^alladv/page([0-9]+)\.html index.php?m=doska&k=all_advert&page_alladvert=$1 [QSA,L]
RewriteRule ^myadverts/?$ index.php?m=doska&k=myadvert [QSA,L]
RewriteRule ^myadverts/page([0-9]+)\.html$ index.php?m=doska&k=myadvert&page_myadvert=$1 [QSA,L]
RewriteRule ^deladv([0-9]+)\.html$ index.php?m=doska&k=deladvert&del_num_advert=$1 [QSA,L]

RewriteRule ^advmetka/(.*)/$ index.php?m=doska&k=adv_setmetka&adv_metvalue=$1 [QSA,L]
RewriteRule ^advmetka/(.*)/advmpage(.*)\.html$ index.php?m=doska&k=adv_setmetka&adv_metvalue=$1&adv_page_metka=$2 [QSA,L]
RewriteRule ^searchadv/?$ index.php?m=doska&k=searchadv [QSA,L]
RewriteRule ^edit/?$ index.php?m=doska&k=editadvert [QSA,L]
RewriteRule ^edit/numadv([0-9]+)\.html index.php?m=doska&k=editadvert&num_adv_edit=$1 [QSA,L]

RewriteRule ^advuser(.*)/$ index.php?m=doska&k=adverts_user&adv_numuser=$1 [QSA,L]
RewriteRule ^advuser(.*)/advuspage(.*)\.html$ index.php?m=doska&k=adverts_user&adv_numuser=$1&adv_page_user=$2 [QSA,L]

 

 

Cik saprotu tad no RewriteEule metas tas errors, ko man nokonfigurēt paša xampp, lai tas neb;utu?

Link to comment
Share on other sites

Ja jau tev ir tik daudz ?m=page to var apvienot vienā samazinot apjomu .htaccess failā un domājams, tā pat ir labāk vai ne tā?

 

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?m=$1 [L,QSA]

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.

Loading...
×
×
  • Create New...