AnryStorm
AnryStorm

Reputation: 23

opencart .htaccess mod_rewrite issue

I am using mode rewrite on an open cart system for seo url-s, it's working great according to the links. BUT I have a php code in the header:

<?php
$request = new Request();
if ( !isset($request->get['route']) ||  $request->get['route']=='common/home' ) { ?>
<div class="center-main">
<?php }else {?>
<div class="center-mainbg">

so if its not common/home, the div should inject <div class="center-mainbg"> and this rule doesent seams to work when mode rewrite is on, it is keeping the <div class="center-main"> rule...

The htaccess rule for mod_rewrite looks like this:

RewriteBase /
RewriteRule sitemap.xml /index.php?route=feed/google_sitemap
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

Upvotes: 0

Views: 1918

Answers (1)

edlerd
edlerd

Reputation: 2145

The way i see it you just need to change the route variable name to:

if ( !isset($request->get['_route_']) ||  $request->get['_route_']=='common/home' ) { ?>

because in the Redirect rule the name of route is between underscores.

Upvotes: 1

Related Questions