.htaccess Mod-Rewrite -Multiviews не работает

По какой-то причине все мои URL работают правильно, кроме перезаписи на продукт: The requested URL /shop/error.php was not found on this server.

Это просто дает старый 404. Я могу заставить его работать правильно, если я все поменяю на RewriteRule ^shop/xxxx/ где xxxx - категория, подкатегория, список соответственно.

Я также попытался изменить параметры без каких-либо изменений. Любые идеи, что может быть причиной этого вопроса?

RewriteEngine on
Options +SymLinksIfOwnerMatch +FollowSymLinks -MultiViews

# category
RewriteRule ^shop/([^/\.]+)/?$ category.php?url_key=$1 [NC,L]

# sub category
RewriteRule ^shop/([^/.]+)/([^/.]+)$ subcategory.php?url_key=$1&url_key2=$2 [NC,L]

# list (from subcategory page; will have 3 variables)
RewriteRule ^shop/([^/.]+)/([^/.]+)/([^/.]+)$ list.php?mr=3&url_key1=$1&url_key2=$2&url_key3=$3 [NC,L]

# list (from category page; will have 4 variables)
RewriteRule ^shop/([^/.]+)/([^/.]+)/([^/.]+)/([^/.]+)$ list.php?mr=4&url_key1=$1&url_key2=$2&url_key3=$3&url_key4=$4 [NC,L]

# product 
#RewriteRule ^shop/([^/.]+)$ product.php?url_key=$1 [NC,L]

# business types
RewriteRule ^shop/restaurant-supply-business-type section.php?id=1 [NC,L]

# login
RewriteRule ^shop/customer/account/login login.php [NC,L]

# brands
RewriteRule ^shop/shopby/brand brands.php [NC,L]

# professional services
RewriteRule ^shop/professional-services professional_services.php [NC,L]

# pages 
RewriteRule ^locations/([^/.]+)$  page.php?url_key=locations/$1 [NC,L]
RewriteRule ^locations page.php?url_key=locations [NC,L]
RewriteRule ^testimonials page.php?url_key=testimonials [NC,L]
RewriteRule ^contact-us page.php?url_key=contact-us [NC,L]
RewriteRule ^equipment-checklist page.php?url_key=equipment-checklist [NC,L]
RewriteRule ^shipping page.php?url_key=shipping [NC,L]
RewriteRule ^returns page.php?url_key=returns [NC,L]
RewriteRule ^lease-financing page.php?url_key=lease-financing [NC,L]
RewriteRule ^news page.php?url_key=news [NC,L]
RewriteRule ^advice page.php?url_key=advice [NC,L]
RewriteRule ^about-us page.php?url_key=about-us [NC,L]
RewriteRule ^careers page.php?url_key=careers [NC,L]
RewriteRule ^privacy page.php?url_key=privacy [NC,L]
RewriteRule ^terms-of-use page.php?url_key=terms-of-use [NC,L]
RewriteRule ^page/([^/.]+)$ page.php?url_key=$1 [NC,L]
RewriteRule ^section/([^/.]+)$ section.php?url_key=$1 [NC,L]


# Remove all .php extensions without interfering with .js or .css.
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !pagespeed
RewriteRule ^([^.]+?)/?$ $1.php [L]

# Remove index from url.
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d

# RewriteRule ^([^.]+?)/?$ index.php?$1 [L,QSA]

0 ответов

Другие вопросы по тегам