Jump to content

RewriteRule not working on all words


emptry

Recommended Posts

Hello Freaks! ;)

 

I have som problems with a rewrite rule, hope u can help me.

 

I can visit:

 

https://dagenshug.dk/produkter/Begge

https://dagenshug.dk/produkter/Him

https://dagenshug.dk/produkter/Her

 

even this!

 

https://dagenshug.dk/produkter/asdasdasdasd

 

But if i want to visist

 

https://dagenshug.dk/produkter/Ham

 

OR

 

https://dagenshug.dk/produkter/Hende

 

Then i dont work, and i'll be redriected to 404 :S .. How come ? - It is the same code i am using..

 

 

 

 

Options +Indexes +FollowSymLinks -MultiViews
RewriteEngine On
#SSL REDIRECT
RewriteCond %{HTTPS} off
 
#404 REDIRECT
ErrorDocument 404 https://dagenshug.dk/404/
RewriteCond %{REQUEST_URI} ^/404/$
RewriteRule ^(.*)$ index.php?page=404.php [L]
 
 
#SEO FRIENDLY CODES
RewriteRule ^home index.php [NC,L]
RewriteRule ^kontakt index.php?page=contact.php [NC,L]
RewriteRule ^gevinst index.php?page=campaign.php [NC,L]
RewriteRule ^tak-for-handlen index.php?page=checkout-finish.php [NC,L]
RewriteRule ^endnu-engang-tillykke index.php?page=campaign-finish.php [NC,L]
RewriteRule ^gevinst index.php?page=campaign.php [NC,L]
RewriteRule ^Dagenshug index.php?page=dagenshug.php [NC,L]
RewriteRule ^Kundeservice/([0-9a-zA-Z]+) index.php?page=customerservice.php#$1 [NC,L]
RewriteRule ^Kundeservice index.php?page=customerservice.php [NC,L]
RewriteRule ^Om-dagenshug index.php?page=about.php [NC,L]
RewriteRule ^kurv/([0-9a-åA-Å_-]+)/([0-9a-åA-Å_-]+) index.php?page=cart-controller.php&product_number=$1&size=$2 [NC,L]
RewriteRule ^kurv/([0-9a-åA-Å_-]+) index.php?page=cart-controller.php&product_number=$1 [NC,L]
RewriteRule ^kurv index.php?page=cart.php [NC,L]
RewriteRule ^produkter/([0-9a-åA-Å_-]+)/([0-9a-åA-Å_-]+) index.php?page=category.php&category_sex=$1&category_name=$2
RewriteRule ^produkter/([0-9a-åA-Å_-]+) index.php?page=category.php&category_sex=$1 [NC,L]
RewriteRule ^produkt/([0-9a-åA-Å_-]+) index.php?page=product.php&product_url_link=$1 [NC,L]
RewriteRule ^kassen opc-checkout.php [NC,L]
RewriteRule ^mail/ mail-order-confirm.php [NC,L]
RewriteRule ^nyheder index.php?page=blog.php [NC,L]

 

 

Link to comment
Share on other sites

a-åA-Å
You can't do that. mod_rewrite [probably] only works with individual ASCII bytes so a-å and A-Å will not work the way you think they will.

 

The best thing to do would probably be to loosen the restriction and let your PHP handle it from there:

([^/]+)
Link to comment
Share on other sites

I just think it is wierd that some of them is working and others are not...

It's to do with the bytes involved. Not characters.

 

what do you mean by letting php handle it ?

Your PHP code is already be able to deal with invalid categories (at least it should have been able to) so loosening the regex means that some of the categories the RewriteRule could have rejected will instead be rejected by your PHP code.
Link to comment
Share on other sites

I don't know what you're doing but I get a normal page - at least as far as I can tell.

 

You say "redirected". Does the URL change too? Your browser may be remembering the redirect from before. Close and restart?

Link to comment
Share on other sites

I just visit the site with a different browser..

 

and ... NO PROBLEMO! :o! WHAT !

 

So i think i need to empty the cache in Chrome ? ...  but, then hit CTRL+F5, then it shoudl empty the cache, right ?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.