How to have multiple rewritable devices with .htaccess?

I am trying to create a multilingual website with Drupal.

I like to have the following URL format

http://domain/[language]/[node id]

so I added the following rule: .htaccess for testing purposes

RewriteRule ^jpn/[0-9]$ jpn.html

The problem is that the rule is overwritten by the following rule

RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

How do I get a few rewrite rules?

+5
source share
2 answers

Your second one is RewriteRuleset L Flag, which means that if this rule matches, no additional rules will be processed.

If you want your first rule to also stop further processing, add the L flag to it as well.

RewriteRule ^jpn/[0-9]$ jpn.html [L]

, , (. *), , , Apache .

: URL- L Flag

+9

, [L] , . , , , 1 Atome RewriteRule, , , . , 2 , 1 htaccess, .

100%

RewriteRule ([a-zA-Z_]+)/([a-zA-Z_]+)/([a-zA-Z_]+)\.htm$ display.php?$1&category=$2 [L]
RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)\.htm$  news.php?$1 [L]

Displ

2 link1 ..., , ?

RewriteRule ([a-zA-Z_]+)/([a-zA-Z_]+)/([a-zA-Z_]+)\.htm$ display.php?$1&category=$2 [L]
RewriteRule ^/?([a-zA-Z_]+)/([a-zA-Z_]+)/([a-zA-Z_]+)\.htm$ news.php?$1&obj=$2&search=$3 [L]

Displ

0
source

All Articles