Jump to content
php.lv forumi

htaccess atstarpes %20


mypoint

Recommended Posts

Kādu labu laiku pūlos atrisināt problēmu ar .htaccess atstarpēm, kas tiek pārmainītas uz %20

Visādus veidus mēģināju bet nekas nesanāk.

 

Vajadzētu, lai %20 nomaina uz _ vai - .

 

Pašlaik htaccess failā:

 

RewriteRule ^prece/([-a-za-z0-9]+)/([-a-za-z0-9]+)$ saraksts.php?page=preces&id=$1&title=$2

 

Labākais variants ko dabūju bija:

Preces%20Nosaukums-Te

 

Lietojot:

 

Options +FollowSymlinks -MultiViews

RewriteRule ^(.+)(\s|%20)(.+)$ /$1-$3 [R=301,QSA,L,NE]

Link to comment
Share on other sites

Es kodētu tā, lai tādas "atstarpes" nerastos, tipa jau slug sarakstā man būtu:

 

nevis Preces%20Nosaukums-Te

bet gan

Preces-Nosaukums-Te

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...