5
5
5nook2012-12-23 14:04:55
System administration
5nook, 2012-12-23 14:04:55

How to write rules for htaccess in my case?

I need help, I've spent the whole weekend googling here on such issues.
You need to teach the site to work according to the rules that are written through htaccess (this is the best option)
#1
Instead of
site.ru/page.html/
Redirect to
site.ru/page.html
#2
Instead of
site.ru/catalog
Redirect to
site. ru/catalog/
#3
Instead of
site.ru//catalog//
Redirect to
site.ru/catalog/
#4
Instead of
site.ru/index/
Redirect to
site.ru/
#5
Instead
of site.ru/blog/name-blog /page1/
Redirect to
site.ru/blog/name-blog/
PS I understand that I ask a lot, with me for a beer!
PSPS By the way rule #2 did

RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
3
3vi1_0n3, 2012-12-28
@3vi1_0n3

And by such words googled?
www.google.ru/search?q=%D0%B3%D0%B5%D0%BD%D0%B5%D1%80%D0%B0%D1%82%D0%BE%D1%80+%D0% BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB+htaccess

E
emailAlexander, 2013-01-06
@emailAlexander

#one

RewriteCond %{REQUEST_URI} \.html/$ [NC,L]
RewriteRule ^(.*)/$ http://site.ru/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question