2

htaccessファイルに書き込みルールがありますが、2つのルールが競合しています。私のhtaccessファイルは:

# BEGIN REMOVE SLUG CUSTOM POST TYPE RULES
RewriteRule ^service-status/(.+)/$ /$1 [R=301,L]
RewriteRule ^country/(.+)/$ /$1 [R=301,L]
RewriteRule ^company/(.+)/$ /$1 [R=301,L]
# END REMOVE SLUG CUSTOM POST TYPE RULES


RewriteRule ^([a-zA-Z0-9_-]+)/numero/$ ?country=$1
RewriteRule ^introduction/([a-zA-Z0-9_-]+) ?company=$1
RewriteRule ^pays/(.+)?$ /pays?company=$1
RewriteRule ^([^/]*)/([^/]*)/$ /index.php?country=$1&company=$2

# BEGIN WordPress
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /ade/
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /ade/index.php [L]
</IfModule>

# END WordPress
all rule working fine but 
RewriteRule ^([^/]*)/([^/]*)/$ /index.php?country=$1&company=$2
RewriteRule ^([a-zA-Z0-9_-]+)/numero/$ ?country=$1
conflict each other both are working fine Individually   

1のようなURLが必要です。http://abc.com/country-name/companyname/

(RewriteRule ^([^/]*)/([^/]*)/$ /index.php?country=$1&company=$2)

2.http://abc.com/country-name/numero/(numeroは修正キーワードです)

RewriteRule ^([a-zA-Z0-9_-]+)/numero/$ ?country=$1

よろしくお願いします。ありがとうBallu

4

1 に答える 1

1

これを試して :

# BEGIN REMOVE SLUG CUSTOM POST TYPE RULES
RewriteRule ^service-status/(.+)/$ /$1 [R=301,L]
RewriteRule ^country/(.+)/$ /$1 [R=301,L]
RewriteRule ^company/(.+)/$ /$1 [R=301,L]
# END REMOVE SLUG CUSTOM POST TYPE RULES


RewriteRule ^([a-zA-Z0-9_-]+)/numero/$ ?country=$1
RewriteRule ^introduction/([a-zA-Z0-9_-]+) ?company=$1
RewriteRule ^pays/(.+)?$ /pays?company=$1
RewriteRule ^([^/]*)/([^/]*)/$ /index.php?country=$1&company=$2

# BEGIN WordPress
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /ade/
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /ade/index.php [L]
</IfModule>

# END WordPress
RewriteRule ^([a-zA-Z0-9_-]+)/numero/$ ?country=$1 [L]
RewriteRule ^([^/]*)/([^/]*)/$ /index.php?country=$1&company=$2 [L]
于 2012-10-25T11:39:29.787 に答える