B
B
belyak942016-03-23 22:22:59
htaccess
belyak94, 2016-03-23 22:22:59

How to make a part of the url in cnc with htaccess start after another but besides the same one?

there is such a situation with CNC about languages:
for example, you need to make links of this type with a choice of language and without
mysite.com/blog
and
mysite.com/lang/en/blog
if you make such a rule
RewriteRule ^lang/(.*)/$ index .php?dir=main〈=$1
RewriteRule blog$ index.php?dir=blog [L]
then it works but how to make it not output like this when clicking on languages ​​- mysite.com/lang/en/lang/en

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2016-03-24
@shambler81

RewriteCond %{REQUEST_URI} !/lang/en/.*$
RewriteRule ^lang/(.*)/$ index.php?dir=main〈=$1

RewriteCond %{REQUEST_URI} !/blog/.*$
RewriteRule blog$ index.php?dir=blog	[L]

! - negation
RewriteCond -if

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question