Zen Cart Logo
Forums / All Other Contributions/Addons / Ceon URI Mapping (SEO)

Ceon URI Mapping (SEO)

Locked

Views: 472,345

Results 1,281 to 1,300 of 2,913
This thread is locked. New replies are disabled.
3 Apr 2010, 5:05 PM
#1281
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Ceon URI Mapping (SEO)

Hi,

Berserker:

Will this module work for an addon domain? Im getting HTTP 404 Not Found when im using exactly the same .htaccess as the main domain.

It'll work for any domain.. the module doesn't care where it is placed.

What is not working for you is your rewrite rule.. that's completely separate from the module.

You've obviously messed up when creating a rewrite rule for your "addon" domain (what's an addon domain? I guess you mean a subdomain?).

Make sure that your site for the subdomain either loads htaccess files and has the proper rewrite rule in the .htaccess file for the subdomain site or set the rewrite rule in the virtualhost directive for the subdomain site.

Also make sure your subdomain's setup doesn't clash with your main domain!

If you aren't sure what to do you might want to search the net for more information or pay a developer to help you.

Hope that helps!

All the best..

Conor
ceon

3 Apr 2010, 6:16 PM
#1282
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

It's an add-on domain. It has it's own domain name instead of using the same domain name as the main account (subdomain).
I've spoken with my webhost and they said that their addon domains does support .htaccess files.
Below is what I have in my .htaccess file

Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !.[a-zA-Z]{2,4}$

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/admin.* [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors.* [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) index.php?%{QUERY_STRING} [L]

The above rules is the same as in the main account and the module works there.

Thanks

3 Apr 2010, 7:22 PM
#1283
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

Berserker:

It's an add-on domain. It has it's own domain name instead of using the same domain name as the main account (subdomain).

The above rules is the same as in the main account and the module works there.

"Addon domains", "Main accounts".. I don't know what you mean.

A domain has a webspace account with it. That's it! :) Whatever this "addon" stuff is, you need to get your host to sort it out so that you can have it work as a "real" domain.

Sorry I can't be more help than that but this thread is for support of the module, not for general hosting/rewrite rule questions, you should start a new thread for that!

All the best...

Conor
ceon

3 Apr 2010, 7:28 PM
#1284
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Ceon URI Mapping (SEO)

If you are using "add-on" domains, I find this works:

to your .htaccess add:

RewriteCond %{HTTP_HOST} ^(www\.)?YOUR-ADD-ON-DOMAIN-NAME\.com

RewriteRule .* - [L]

and for the directory the add-on lives in:

RewriteCond %{REQUEST_URI} !^/YOUR-ADD-ON-DIRECTORY.* [NC]
3 Apr 2010, 7:31 PM
#1285
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

kiddo:

If you are using "add-on" domains, I find this works:

Thanks for posting the info.. hopefully it works!

What are these "add-on" domains you are both talking about?

Ridiculously cheap ways to host additional sites or something? (Hosting is so cheap these days I can't for the life of me see the need for anything like that?).

All the best..

Conor
ceon

3 Apr 2010, 7:32 PM
#1286
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Ceon URI Mapping (SEO)

One more... Put the above in your main web root.
And if you use the CEON mod in the ad-on domain, put the .htaccess file in the directory of the add-on as if it was its own domain.

You can do this for multiple add-ons as long as you accomodate them (ignore them) in your main .htaccess

Clear as mud?

3 Apr 2010, 7:34 PM
#1287
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Ceon URI Mapping (SEO)

conor:

Hi,

Thanks for posting the info.. hopefully it works!

What are these "add-on" domains you are both talking about?

Ridiculously cheap ways to host additional sites or something? (Hosting is so cheap these days I can't for the life of me see the need for anything like that?).

All the best..

Conor
ceon

Some hosts allow you to point additional domains at your account and host them as if they were stand-alone domains. For the most part, it works pretty well. Each add-on lives in a directory under the main web root.

I know BH, HM and CH offer this. Seems to be pretty common these days.

3 Apr 2010, 8:12 PM
#1288
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

I was hoping it would work but didnt...

This is what i have in the htaccess of the main domain

RewriteCond %{REQUEST_URI} !^/addondomain.com.* [NC]

RewriteCond %{HTTP_HOST} ^(www.)?addondomain.com
Rewriterule .* - [L]

Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !.[a-zA-Z]{2,4}$

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/admin.* [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors.* [NC]

Don't rewrite livezilla directory

RewriteCond %{REQUEST_URI} !^/livezilla.* [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) index.php?%{QUERY_STRING} [L]

And this is what I have in the htaccess of the addon domain

RewriteCond %{HTTP_HOST} ^(www.)?addondomain.com

RewriteRule .* - [L]

RewriteCond %{HTTP_HOST} ^addondomain.com
RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=permanent,L]

#RewriteCond %{HTTP_HOST} ^addondomain.com$
#RewriteRule ^/?$ "http://www.addondomain.com" [R=301,L]

Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !.[a-zA-Z]{2,4}$

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/admin.* [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors.* [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) index.php?%{QUERY_STRING} [L]

This module works in the main account but does not for the addon. There's not much difference between both htaccess file...

Thanks

3 Apr 2010, 10:23 PM
#1289
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

In ALL of the RewriteCond patterns above, remove the unwanted trailing . part of the pattern where you are not capturing it in a backreference.*

That is, !^/editors*.**** should be !^/editors here. Same for all of the other patterns.

4 Apr 2010, 12:45 AM
#1290
games4gamers avatar

games4gamers

New Zenner

Join Date:
Dec 2008
Posts:
55
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

g1smd:

In ALL of the RewriteCond patterns, remove the unwanted trailing .* part of the pattern where you are not capturing it in a backreference.

Change the reference to 'admin' to reflect what your admin folder is actually called.

Beware of paths that are localised when used with RewriteRule when the .htaccess is in a folder.

Okay thanks, I will try that.

DivaVocals:

You have your store in a subdirectory and are using a redirect so that when folks hit your main domain they are redirected to the sub-directory??? Why do you have Zen Cart setup in this manner?? You could solve a LOT of your issues by moving Zen Cart into your site root and NOT use a sub directory at all..

Not really sure why. I do have non-Zen stuff stored on the server as well. I came from OSC a year or 2 back so that might have something to do with it.

Thanks for the replies.

4 Apr 2010, 12:58 AM
#1291
games4gamers avatar

games4gamers

New Zenner

Join Date:
Dec 2008
Posts:
55
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

g1smd:

In ALL of the RewriteCond patterns, remove the unwanted trailing .* part of the pattern where you are not capturing it in a backreference.

Change the reference to 'admin' to reflect what your admin folder is actually called.

Beware of paths that are localised when used with RewriteRule when the .htaccess is in a folder.

Hmm okay I did this and it's still redirecting Admin to the home page....weird...

4 Apr 2010, 8:51 AM
#1292
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

g1smd:

In ALL of the RewriteCond patterns above, remove the unwanted trailing . part of the pattern where you are not capturing it in a backreference.*

That is, !^/editors*.**** should be !^/editors here. Same for all of the other patterns.

Sorry but that information is wrong. Matching !^/editors*.* ***or !^/editors is effectively the same as far these rules are concerned.

.* simply means "match any or no further characters".

So it's fine to have it.

You can read more about this if you search for "regular expressions" on the net.

All the best..

Conor
ceon

4 Apr 2010, 9:01 AM
#1293
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

Berserker:

I was hoping it would work but didnt...

This is what i have in the htaccess of the main domain

RewriteCond %{REQUEST_URI} !^/addondomain.com.* [NC]

As far as I can see, this part will never match.

The %{REQUEST_URI} variable doesn't include the host name.

It would only match if you were matching against %{HTTP_HOST}

You are hijacking this thread somewhat to sort out your own hosting problems.

Rather than you posting lots of times I'd rather have a quick go and trying out an option or two to sort this out.

Please send me FTP details for your site and I'll try out a few ideas I have to get this working for you.

I may or may not be able to do that today depending on whether or not I can get internet access later... I'll be off for the Easter Holidays shortly.

All the best...

Conor
ceon

4 Apr 2010, 9:05 AM
#1294
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Ceon URI Mapping (SEO)

Hi,

Thanks for the info!

kiddo:

Some hosts allow you to point additional domains at your account and host them as if they were stand-alone domains. For the most part, it works pretty well. Each add-on lives in a directory under the main web root.

I know BH, HM and CH offer this. Seems to be pretty common these days.

It sounds like a stupid way to set up a website. How hard is it to set up a VirtualHost directive so each additional domain **is **its own website?!

Some companies just don't have a clue unfortunately!

All the best..

Conor
ceon

4 Apr 2010, 9:06 PM
#1295
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: Ceon URI Mapping (SEO)

conor:

Hi,

Thanks for the info!

It sounds like a stupid way to set up a website. How hard is it to set up a VirtualHost directive so each additional domain **is **its own website?!

Some companies just don't have a clue unfortunately!

All the best..

Conor
ceon

I'm pretty sure thats the way it does work. When you enter the info for the add-on domain, the software creates the proper virthost directives.

Some of the certified hosts offer this like coughcamelotcough. Maybe one of those guys could jump in and explain how its really done. I'm guessing the web root directive in the container just points to a sub-dir of the main account.

5 Apr 2010, 6:20 PM
#1296
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

.* simply means "match any or no further characters".

So it's fine to have it.

This is Server Configuration Code. The entire .htaccess file is parsed at least once for every URL request arriving at the server.

That being so, the file should use the most efficient code to get the job done. In this case, trailing .* characters on multiple patterns waste CPU cycles that you might later need elsewhere in serving the pages.

General rule of thumb is to only include such patterns when you need to capture the information in a backreference for later use.

Additionally, every RewriteRule should have the [L] flag to end Mod_Rewrite processing when that rule has matched the current request.

I've seen too many site owners forced into early server upgrades, when in actual fact inefficient code had wasted vast amounts of processing power.

This code is trivial but because it is core to server operation, getting the best possible efficiency is important.

6 Apr 2010, 10:15 AM
#1297
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Hi, I'm not sure if this is the correct place to ask this but I think it may be an issue with this mod.

I've been testing my site's performance using this tool:
http://www.websiteoptimization.com/services/analyze/

When I used the tool to analyse this page:
http://www.snowrepublic.co.uk/FilesStones/DiafaceMoonflexDiamondFile100X25

It is coming back with images not found even though the images are being displayed when I look at the page with my browser.

The path it is saying the images exist on are http://www.snowrepublic.co.uk/FilesStones/images/
but the real path should be http://www.snowrepublic.co.uk/images/

Is there a problem with this mod?
If so, am I seeing my images because my browser has cached them before I installed this mod?

Any help would be grately appreciated.
It may be a problem with the analysis tool; I've asked at weboptimization.com to see what they think.
I'll post their response when I get it.

7 Apr 2010, 9:00 AM
#1298
edizioninautilus avatar

edizioninautilus

New Zenner

Join Date:
May 2009
Location:
Italy
Posts:
19
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

conor:

Hi,

Thanks for the info!

It sounds like a stupid way to set up a website. How hard is it to set up a VirtualHost directive so each additional domain **is **its own website?!

Some companies just don't have a clue unfortunately!

All the best..

Conor
ceon

Guys,

I've just glanced a bit at the discussion here, so don't know if I'm capturing everything, but...

I'm using an add-on domain from my hosting provider (Midphase) for my website (https://www.edizioninautilus.it) and it is able to successfully handle Conor's great URI mapping module.

The add-on domain is all hosted in a sub-directory under the main domain files. I've simply followed the .htaccess rules in Conor's docs and placed that .htaccess file in the root directory of the subdirectory. All seems well.

If you're interested, here's a snapshot of my .htaccess:

RewriteEngine on

Options All -Indexes

RewriteCond %{HTTP_HOST} ^nautilustorino.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.nautilustorino.com$
RewriteRule ^/?$ "http://www.edizioninautilus.it" [R=301,L]

RewriteCond %{HTTP_HOST} ^edizioninautilus.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.edizioninautilus.com$
RewriteRule ^/?$ "http://www.edizioninautilus.it" [R=301,L]

RewriteCond %{HTTP_HOST} ^nautilustorino.it$ [OR]
RewriteCond %{HTTP_HOST} ^www.nautilustorino.it$
RewriteRule ^/?$ "http://www.edizioninautilus.it" [R=301,L]

redirect 301 "/Libri/5000 anni fa - Chiomonte.html" http://www.edizioninautilus.it/5000-anni-fa-chiomonte
redirect 301 "/Libri/Archeologia del Ferro.html" http://www.edizioninautilus.it/archeologia-del-ferro
.
.
.

ErrorDocument 404 /index.php?main_page=page_not_found

Don't rewrite any URIs ending with a file extension (ending with .[xxxx])

RewriteCond %{REQUEST_URI} !.[a-zA-Z]{2,4}$

Don't rewrite admin directory

RewriteCond %{REQUEST_URI} !^/zzzzzzz.* [NC]

Don't rewrite editors directory

RewriteCond %{REQUEST_URI} !^/editors.* [NC]

Don't rewrite payment pages/callback handlers

(Won't be rewritten by rules above but included here in case rewriting of URIs ending in .php is added)

RewriteCond %{REQUEST_URI} !^/ipn_main_handler.php.* [NC]
RewriteCond %{REQUEST_URI} !^/iridium_3d_secure_iframe.php.* [NC]
RewriteCond %{REQUEST_URI} !^/localities_remote_loader.php.* [NC]
RewriteCond %{REQUEST_URI} !^/nochex_apc_handler.php.* [NC]
RewriteCond %{REQUEST_URI} !^/protx_direct_3d_secure_iframe.php.* [NC]
RewriteCond %{REQUEST_URI} !^/realex_remote_3d_secure_iframe.php.* [NC]

Don't rewrite cPanel directories

RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
RewriteCond %{REQUEST_URI} !/frontend.* [NC]

Handle all other URIs using Zen Cart (index.php)

RewriteRule (.*) index.php?%{QUERY_STRING} [L]

I left out a bunch of 301 redirects where the . . . s are in the cut and paste job above because there are a ton of them and they are ultimately just a repeat of the first two that I included.

Hope that helps some.

Jeremy

7 Apr 2010, 9:51 AM
#1299
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Here's some hints to make the code much more efficient or correct common errors:

edizioninautilus:

RewriteCond %{HTTP_HOST} ^nautilustorino.com$ [OR]
RewriteCond %{HTTP_HOST} ^w**ww.nautilustorino.com$A local OR will parse faster when used in .htaccess. Do also remember to escape periods in patterns:```
RewriteCond %{HTTP_HOST} ^b?[/b]nautilustorino[b].[/b]com$




> **edizioninautilus:**
>
> RewriteRule ^/?$ "http\:\/\/www\.edizioninautilus\.it" [R=301,L]Escape special characters when used in patterns, but NOT in the target URL or filepath. End the domain name with a trailing slash:```
RewriteRule ^/?$ "h[i][/i]ttp://w[i][/i]ww.edizioninautilus.it[b]/[/b]" [R=301,L]

edizioninautilus:

redirect 301 "/Libri/5000 anni fa - Chiomonte.html" http://www.edizioninautilus.it/5000-anni-fa-chiomonteYou cannot guarantee module execution order on the server so never mix Redirect and RedirectMatch directives in the same file where RewriteRule is in use. Use RewriteRule for ALL of your redirects and rewrites:```
RewriteRule "Libri/5000 anni fa - Chiomonte.html" h[i][/i]ttp://w[i][/i]ww.edizioninautilus.it/5000-anni-fa-chiomonte [R=301,L]




> **edizioninautilus:**
>
> !\.[a-zA-Z]{2,4}$Using the NC flag will parse 50% faster:```
 !\.[A-Z]{2,4}$ [NC]

edizioninautilus:

RewriteCond %{REQUEST_URI} !^/editors.* [NC]Patterns are essentially prefix matches. In this case the trailing .* pattern is totally redundant. Remove it:```
RewriteCond %{REQUEST_URI} !^/editors [NC]




DO ensure that your redirects are listed from most-specific to most general, with your general non-www to www redirect listed last. After the redirects, list all the rewrites, again from most-specific to most general. Ensure every RewriteRule is terminated with the [L] flag. Redirects will have [R=301,L] instead.
7 Apr 2010, 10:00 AM
#1300
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: Ceon URI Mapping (SEO)

Here's some hints to make the code much more efficient or correct common errors:

edizioninautilus:

RewriteCond %{HTTP_HOST} ^nautilustorino.com$ [OR]
RewriteCond %{HTTP_HOST} ^w**ww.nautilustorino.com$A local OR will parse faster when used in .htaccess. Do also remember to escape periods in patterns:```
RewriteCond %{HTTP_HOST} ^b?[/b]nautilustorino[b].[/b]com$




> **edizioninautilus:**
>
> RewriteRule ^/?$ "http\:\/\/www\.edizioninautilus\.it" [R=301,L]Escape special characters when used in patterns, but NOT in the target URL or filepath. Target URL should not be in quotes. End the domain name with a trailing slash:```
RewriteRule ^/?$ h[i][/i]ttp://w[i][/i]ww.edizioninautilus.it[b]/[/b] [R=301,L]

edizioninautilus:

redirect 301 "/Libri/5000 anni fa - Chiomonte.html" http://www.edizioninautilus.it/5000-anni-fa-chiomonteYou cannot guarantee module execution order on the server so never mix Redirect and RedirectMatch directives in the same file where RewriteRule is in use. Use RewriteRule for ALL of your redirects and rewrites:```
RewriteRule "Libri/5000 anni fa - Chiomonte.html"
h[i][/i]ttp://w[i][/i]ww.edizioninautilus.it/5000-anni-fa-chiomonte [R=301,L]




> **edizioninautilus:**
>
> !\.[a-zA-Z]{2,4}$Using the NC flag will parse 50% faster:```
 !\.[A-Z]{2,4}$ [NC]

edizioninautilus:

RewriteCond %{REQUEST_URI} !^/editors.* [NC]Patterns are essentially prefix matches. In this case the trailing .* pattern is totally redundant. Remove it:```
RewriteCond %{REQUEST_URI} !^/editors [NC]




Apply all of the above fixes to every line of code in your .htaccess file. DO ensure that your redirects are listed from most-specific to most general, with your general non-www to www redirect listed last. After the redirects, list all the rewrites, again from most-specific to most general. Ensure every RewriteRule is terminated with the [L] flag. Redirects will have [R=301,L] instead.