Jump to content

Search Engine friendly URLs problem


vidmarc

Recommended Posts

It's a clean install

 

www.nucleusfilms.com

 

Cubecart 5.2.1

##### NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]

# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]

# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC] 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]
######## Added by 1&1 Abuse department -- BEGIN
# only remove if you enconter problems related to php5
# take different measures to secure your scripts in this case
AddType x-mapp-php5 .php
######## Added by 1&1 Abuse department -- END


## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>

#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *

#### Rewrite rules for SEO functionality ####

<IfModule mod_rewrite.c>
  RewriteEngine On

  ######## START v4 SEO URL BACKWARD COMPATIBILITY ########
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule cat_([0-9]+)(.[a-z]{3,4})?(.*)$	index.php?_a=category&cat_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule prod_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule info_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=document&doc_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule tell_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule _saleItems(.[a-z]+)?(?.*)?$		index.php?_a=saleitems&%1 [NC,L]
  ######## END v4 SEO URL BACKWARD COMPATIBILITY ########

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>
 
Link to comment
Share on other sites

You said it was a clean install, but there seems to be lots of stuff in the htaccess from other sources - v4 mods?. I don't know enough to make suggestions, but hopefully those who can help will know what needs to be changed.

 

I have more in my file, due to Fusion skin options, but I think this is all from mine that was stock - caveat - backup yours if you choose to try this file!

## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>
#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *
#### Rewrite rules for SEO functionality ####
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^STOREDOMAIN$
RewriteRule ^(.*)$ http://STOREDOMAIN/$1 [R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>
Link to comment
Share on other sites

Sorry, my mistake. This is the actual .htaccess file I was using.

 

##### NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
 
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
 
# From Ultimate SEO URLs
RewriteRule ^(.*)-p-(.*).html$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-(.*).html$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+).html$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+).html$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+).html$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
 
# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]
 
# For dreamscape's News & Articles Manager
RewriteRule ^news/?$ index.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.*)-a-([0-9]+).html$ index.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]
 
# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC] 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]
######## Added by 1&1 Abuse department -- BEGIN
# only remove if you enconter problems related to php5
# take different measures to secure your scripts in this case
AddType x-mapp-php5 .php
######## Added by 1&1 Abuse department -- END
 
 
## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>
 
#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *
 
#### Rewrite rules for SEO functionality ####
 
<IfModule mod_rewrite.c>
  RewriteEngine On
 
  ######## START v4 SEO URL BACKWARD COMPATIBILITY ########
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule cat_([0-9]+)(.[a-z]{3,4})?(.*)$ index.php?_a=category&cat_id=$1&%1 [NC]
 
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule prod_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC]
 
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule info_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=document&doc_id=$1&%1 [NC]
 
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule tell_([0-9]+)(.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC]
 
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule _saleItems(.[a-z]+)?(?.*)?$ index.php?_a=saleitems&%1 [NC,L]
  ######## END v4 SEO URL BACKWARD COMPATIBILITY ########
 
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>
Link to comment
Share on other sites

When I enable SEO URLs and click on a product from the home page the url appears in the browser  address bar but the home page remains.

 

Same with selecting any of the category listings - the url appears in the address bar but the store remains on the home page.

Link to comment
Share on other sites

Your .htaccess file is executing this rule first:

RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]

 

I suggest you remove everything above the "Added by 1&1 abuse" line.

 

I think that leaves you with this:

######## Added by 1&1 Abuse department -- BEGIN
# only remove if you enconter problems related to php5
# take different measures to secure your scripts in this case
AddType x-mapp-php5 .php
######## Added by 1&1 Abuse department -- END


## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>

#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *

#### Rewrite rules for SEO functionality ####

<IfModule mod_rewrite.c>
  RewriteEngine On

  ######## START v4 SEO URL BACKWARD COMPATIBILITY ########
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule cat_([0-9]+)(.[a-z]{3,4})?(.*)$	index.php?_a=category&cat_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule prod_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule info_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=document&doc_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule tell_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule _saleItems(.[a-z]+)?(?.*)?$		index.php?_a=saleitems&%1 [NC,L]
  ######## END v4 SEO URL BACKWARD COMPATIBILITY ########

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>

Did the one I suggested not work, either? Mine doesn't have the 1and1 section (which you probably need to keep) or the backward compatibility section (which I'm thinking you don't need since this was a clean install).

Link to comment
Share on other sites

Weird, I haven't even downloaded it.

 

 



Your .htaccess file is executing this rule first:

RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]

 

I suggest you remove everything above the "Added by 1&1 abuse" line.

 

I think that leaves you with this:

######## Added by 1&1 Abuse department -- BEGIN
# only remove if you enconter problems related to php5
# take different measures to secure your scripts in this case
AddType x-mapp-php5 .php
######## Added by 1&1 Abuse department -- END


## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>

#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *

#### Rewrite rules for SEO functionality ####

<IfModule mod_rewrite.c>
  RewriteEngine On

  ######## START v4 SEO URL BACKWARD COMPATIBILITY ########
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule cat_([0-9]+)(.[a-z]{3,4})?(.*)$	index.php?_a=category&cat_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule prod_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule info_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=document&doc_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule tell_([0-9]+)(.[a-z]{3,4})?$		index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule _saleItems(.[a-z]+)?(?.*)?$		index.php?_a=saleitems&%1 [NC,L]
  ######## END v4 SEO URL BACKWARD COMPATIBILITY ########

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>

Did the one I suggested not work, either? Mine doesn't have the 1and1 section (which you probably need to keep) or the backward compatibility section (which I'm thinking you don't need since this was a clean install).

 

 

I just tried this .htaccess file but now I'm getting error 404s.

 

The urls are strange too. Something is very wrong, as these are all for different products:

http://www.nucleusfilms.com/death-ship-p16-p18.html

http://www.nucleusfilms.com/education-anglaise-p24-p25-p26-p27-p28-p29-p30-p31-p32.html

http://www.nucleusfilms.com/death-ship-p16-p18-p19.html
Link to comment
Share on other sites

Try this

## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>
#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *
#### Rewrite rules for SEO functionality ####
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^STOREDOMAIN$
RewriteRule ^(.*)$ http://STOREDOMAIN/$1 [R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>
Link to comment
Share on other sites

I changed STOREDOMAIN but it doesn't work at all now. No site loads.

## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>
#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *
#### Rewrite rules for SEO functionality ####
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^STOREDOMAIN$
RewriteRule ^(.*)$ http://www.nucleusfilms.com/$1 [R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>
Link to comment
Share on other sites

Yes, and sadly  the site won't load at all.

 

This .htaccess rewrite thing has me stumped. See error below.

## File Security
<FilesMatch ".(htaccess)$">
 Order Allow,Deny
 Deny from all
</FilesMatch>
#### Apache directory listing rules ####
DirectoryIndex index.php index.htm index.html
IndexIgnore *
#### Rewrite rules for SEO functionality ####
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^nucleusfilms.com$
RewriteRule ^(.*)$ http://www.nucleusfilms.com/$1 [R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*).html?$ index.php?seo_path=$1 [L,QSA]
</IfModule>

 

"Too many redirects occurred trying to open "http://www.nucleusfilms.com/".

This might occur if you open a page that is redirected to open another page which is then redirected to open the original page.

 

Link to comment
Share on other sites

As an experiment, remove this:

RewriteCond %{HTTP_HOST} !^nucleusfilms.com$
RewriteRule ^(.*)$ http://www.nucleusfilms.com/$1 [R=301]

 

Then, the following wierdness has been discovered: if you are using the Chrome browser, "Too Many Redirects" could be caused by the weird fact that your computer's time may be off by too many minutes. Please verify that your computer's time is set as closely as possible to the real world time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...