S
S
Sergey2011-10-05 03:24:23
Apache HTTP Server
Sergey, 2011-10-05 03:24:23

Understand mod rewrite?

There is a link structure:
sitename.ru/glavnaya/portfolio
sitename.ru/glavnaya/portfolio/site1
How to remove glavnaya?
What should be written in .htacces?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Roman Kutenko, 2011-10-05
@Sky4eg

RewriteRule ^glavnaya/(.+)$ sitename.ru/ $1 [R=301,L]

A
alexeysilver, 2011-10-05
@alexeysilver

I would do it like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) sitename.ru/glavnaya/ $1 [L]

K
KaterSpieler, 2011-10-05
@KaterSpieler

Do you write under some kind of engine, or with your hands?
Everything that interests you is done, for example, like this:
Redirect 301 /d/file.html www.domainname.com/r/file.html
And here is a good site that fully reveals the possibilities of .htacces
www.proofsite.com.ua/ article-2242.html

R
Rodion Gashé, 2011-10-05
@zorba_buddha

checked, plows:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/glavnaya/
RewriteRule ^(.*)$ /glavnaya/$1 [PT,QSA]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question